האם לשפר את קריאות API של תוסף ה-AI?

היי חברים,

אני עובד בסביבת ארגון ואנחנו משתמשים ב-Discourse כלוח דיונים לתמיכת פלטפורמת ענן.
אנחנו רוצים להשתמש בתוסף ה-AI של Discourse למספר מקרים ושיש לנו גם נקודות קצה פנימיות של AI התואמות ל-OpenAI.

הדבר הוא שכאשר נשלחים בקשות חיצוניות לנקודות קצה אלה, יש לכלול בכותרת האותנטיקציה אסימון OAuth2 שמגיע מנקודת גישה פנימית של מ- M2M שיש לקבל מראש.

חשבתי על כמה גישות, כמו פרוקסי מקומי על מופע EC2 שמארח את Discourse, שיכול להעשיר את הבקשה עם המידע הזה.
גישה נוספת היא שער API עם ל middleware שמקבל את האסימון.

מה שלא הבנתי עד עכשיו הם הכלים שאפשר להוסיף בתוך תוסף ה-AI של Discourse.
האם זה יכול לשמש כדי להשיג את מה שיש לי בראש?

המון תודה על התמיכה שלכם ושיהיה לכם יום נהדר!

בברכה,

WS

This is a tough one.

We generally do not like to add too many knobs cause it confuses people but I hear you that this is hard to solve now, we may need another knob.

One option would be to allow the open ai compatible to have a “custom headers” section.

Tools could not easily solve this cause this would create an incredibly complex workflow and we don’t have the ability of easily passing all the information the tool needs.

@Falco thoughts?

Moving this to feature, cause it is a feature request.

לייק 1

היי @sam,

תודה על התגובה שלך ועל המחשבות שלך בנושא.

שדה עבור כותרות מותאמות אישית לא יספיק, מכיוון שיש צורך לקבל את הטוקן באופן דינמי לפני כל קריאת API.

אולי עדיף סוג של צינור / תיווך, שבו מישהו יכול לשנות את כל הקריאה היוצאת עם הקוד שלו לפני שהיא נשלחת?

תודה רבה לכם ויהיה יום מצוין!

בברכה,

WS

Yikes this really is quite advanced.

I guess if custom tools came with enough richness they could accomplish this… it does feel like a bit of a rube goldberg machine but imagine.

  1. IF a configuration with a persona:
    1. Forces tool calls
    2. Has a custom tool forced and it has NO params
  2. THEN we invoke no LLM and simply pass control to the tool
  3. THEN we give the tool enough infra to stream results back to the app via inversion of control in some fashion

Its a pretty staggering amount of change and would end up being an absolute bear to maintain.

I guess an alternative is for you to define a new custom plugin that depends on Discourse-AI and defines your own Dialect and Endpoint - it is certainly the simplest way to go about this.

It is sooooo much easier to solve this specific need via a lightweight proxy, like Nginx with LUA scripting, that I think @Wurzelseppi will be better served going that route.

לייק 1

Hey guys,

you´re awesome discussing the need of a small user like me in earnest. I´m always struck by your dedication, and I mean it (no joke :slight_smile: )

Yeah, as the whole thing runs on a ec2 instance and I already decided to go the AWS API Gateway → Lambda → LLM endpoint way …

Built in into discourse would be cooler, but I understand the complexity that would bring, of course …

Thanks a lot for your time, and the time you help all users here!

Couldn´t think of a better board software, not only because of the maturity of the software, but also because of the people who lend support.

Great week, guys … and stay as you are!

Cheers,

WS

לייק 1