-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: add new generic AI communication model #15409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add new generic AI communication model #15409
Conversation
1c27668
to
a06f488
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much Stefan!
This looks already very good and it is great to get rid of the clunky manual recording and this should be a solid foundation to extract all sorts of useful data for testing, simulation, etc.
I was wondering how we reflect function calls? I don't see them being recorded at the moment, right?
The remaining comments I'd have are related to naming:
AiSession, AiSemanticRequest, AiRequest
I'm not sure "Ai" is a great prefix. Essentially it is a record of a LanguageModelRequest or session. Also I find the use of the term "Semantic" a bit unclear.
Here are a few ideas, instead of switching to a different prefix, like Ai, and avoiding "semantic":
- AiSession ->
RawLanguageModelSession
orLanguageModelInteraction
- AiSemanticRequest ->
ClientRequest
(the original request for tracing raw language model requests to a client event) - AiRequest ->
RawLanguageModelRequest
Thank you!
Tool Calls including their ids, parameters and result are recorded as part of the responses, see here.
With semantic request I wanted to express that it's representing what the user might think of a single request. I'll further think about the naming. Thanks for the feedback! |
Thanks! Yes that makes a lot of sense to capture that. It could also be any client, such as a service though, right? Therefore I was leaning towards |
Adds a new AI communication model for tracking raw LLM requests and responses. Tracking is automated via the language-model-service. This model serves as the foundation for: - Extracting communication history from Theia AI, allowing LLM testing without running the full Theia-based application - Replaying LLM communication without using an actual LLM, enabling deterministic integration tests - Removing the clunky communication recording service, making the ai-history package optional Resolves eclipse-theia#15221 Contributed on behalf of STMicroelectronics
a06f488
to
9bd59e9
Compare
Hi @planger, Thanks for your input! I adapted the naming a bit and split the PR into two PRs:
Please check whether you like it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent, thank you! This looks very clean and useful to me. I tested it with #15540
/** | ||
* An exchange unit representing a logical operation which may involve multiple model requests. | ||
*/ | ||
export interface LanguageModelExchange { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a nitpick: I am ok with LanguageModelExchange
but I was wondering what you think about LanguageModelCompletion
as a more direct term for what actually happens (i.e. an LLM request completion). Exchange sounds to me a bit bi-directional and not a perfect fit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The exchange consists of request-response pairs, so it feels bidirectional to me. Personally I like "exchange" better than "completion". I would have never guessed that a "LanguageModelCompletion" is a set of request-response pairs, unrelated to "normal" LLM completion.
What it does
Adds a new AI communication model for tracking raw LLM requests and
responses. Tracking is automated via the language-model-service.
This model serves as the foundation for:
without running the full Theia-based application
deterministic integration tests
ai-history package optional
Resolves #15221
Remaining tasks:
Adapt History View UITrack timestamps and response timestamps differentlyDo not highlight all semantic requestsShow logged streamed responses in a nicer UIRemove communication service, adapt all affected code and make ai-history package optionalUpdate changelog for breaking changeMoved the remaining tasks into a new PR (#15540) to make the PRs smaller.
How to test
Debug the language-model-service.
Alternatively you can check the follow up PR (#15540) to see the new model integrated in the AI History view.
Follow-ups
Breaking changes
Attribution
Contributed on behalf of STMicroelectronics
Review checklist
Reminder for reviewers