refactor(ai): Adopt whilesmartgo/agents for the model engine#183
Merged
Conversation
The assistant's OpenAI-compatible model client was a bespoke copy of the chat-completions wire format. It now comes from the shared whilesmartgo/agents library, so the same engine is reused rather than maintained in two places. Behaviour is unchanged: the existing provider tests pass as-is. This is the engine-layer step of adopting the extracted agent core; expressing the tools and the tool loop through the library's Registry and Runner follows.
Code Review SummaryThis PR refactors the OpenAI-compatible model engine to utilize the 🚀 Key Improvements
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First step of #182. The assistant's OpenAI-compatible model client was a bespoke copy of the chat-completions wire format; it now delegates to
github.com/whilesmartgo/agents(the core extracted from this same code), so the engine is reused instead of maintained twice. Net -84 lines here, and the shared library is now a direct dependency.Behaviour is unchanged: the existing provider tests (completion, tool calling, keyless, error mapping) pass without edits, which is the point of keeping FlatRun's
Provider/Request/Responsetypes and mapping across the boundary.Still on #182, as follow-ups: expressing the built-in tools as
agents.Toolvalues and driving the session loop throughagents.Runner. Those are held back because FlatRun's stored message carries UI-only fields (display, hidden) the library's minimal message does not, so deeper adoption wants either a library message-metadata field or a session-model change.