Skip to content
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

Refactor: ChatAgent #1424

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open

Refactor: ChatAgent #1424

wants to merge 30 commits into from

Conversation

WHALEEYE
Copy link
Collaborator

@WHALEEYE WHALEEYE commented Jan 10, 2025

Description

Thoroughly refactored ChatAgent.

Motivation and Context

  • Move function calling into model backends - OpenAI Supported
  • Move structured output into model backends - OpenAI Supported
  • Code quality improvement inside ChatAgent
  • Support true asynchronous model calling
  • Support tool calling for stream output

This will close #1334.

Important Changes

For the convenience of the reviewers, the important changes to the code are listed here:

  1. rename functions: async functions are prefixed with a instead of being postfixed with async, for example, step_async -> astep, to make it more concise.
  2. moved some of the internal function and types into _utils.py and _types.py.
  3. added async version of stream handling.
  4. added an internal type ModelResponse to represent the responsefrom models, which will only be used in internal ChatAgent.
  5. removed all keys with None value in configs after as_dict().

@WHALEEYE WHALEEYE self-assigned this Jan 10, 2025
@WHALEEYE WHALEEYE linked an issue Jan 10, 2025 that may be closed by this pull request
2 tasks
@WHALEEYE WHALEEYE marked this pull request as ready for review January 25, 2025 20:12
@WHALEEYE WHALEEYE requested a review from Wendong-Fan January 25, 2025 20:12
poetry.lock Outdated Show resolved Hide resolved
Copy link
Collaborator

@MuggleJinx MuggleJinx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Zhaoxuan! it's a lot of wrok! I left some small comments. It looks good to me, we can merge it soon if all test has been passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

[Feature Request] ChatAgent further refactor
3 participants