camel icon indicating copy to clipboard operation
camel copied to clipboard

[Feature Request] Refactor `ChatAgent`

Open Wendong-Fan opened this issue 10 months ago • 1 comments

Required prerequisites

  • [X] I have searched the Issue Tracker and Discussions that this hasn't already been reported. (+1 or comment there if it has.)
  • [X] Consider asking first in a Discussion.

Motivation

  1. current ChatAgent is redundant, we want to refactor this class to make it more tidy
  2. we need to support passing API Key as parameter into ChatAgent , this feature is required for the platform development
  3. remove ChatGPTVisionConfig , merge FunctionCallingConfig into ChatGPTConfig to make the abstraction tidy as discussed in https://github.com/camel-ai/camel/pull/473

Solution

  1. Separate initialization of model and chat agent
  2. model_type ,model_config ,message_window_size,token_limit move to model
  3. move def handle_batch_response and def handle_stream_response from chat agent to model
  4. add config folder, set model config based on framework
  5. Model.create(platform='', model='',...)

Alternatives

No response

Additional context

No response

Wendong-Fan avatar Apr 23 '24 14:04 Wendong-Fan

@ocss884 @zechengz feel free to add content into this issue description

Wendong-Fan avatar Apr 23 '24 15:04 Wendong-Fan