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 ModelWrapper #24

Merged
merged 17 commits into from
Feb 19, 2024

Conversation

pan-x-c
Copy link
Collaborator

@pan-x-c pan-x-c commented Feb 2, 2024


name: Refactor ModelWrapper

Description

  1. automatically register ModelWrapperBase subclass
  2. support to create ModelWrapperBase using class name
  3. use ModelResponse to decouple Agent and Model
  4. add Post API ModelWrappers compatible with OpenAI API
  5. Remove OpenAI/PostAPICfg, and use ModelConfig instead
  6. rename type to model_type, model to model_id
  7. add unittests for model wrapper

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has passed all tests
  • Docstrings have been added/updated in Google Style
  • Documentation has been updated
  • Code is ready for review

@pan-x-c pan-x-c added the enhancement New feature or request label Feb 2, 2024
@pan-x-c pan-x-c self-assigned this Feb 2, 2024
Copy link
Collaborator

@DavdGao DavdGao left a comment

Choose a reason for hiding this comment

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

Plz see inline comments.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
docs/sphinx_doc/source/tutorial/103-example.md Outdated Show resolved Hide resolved
docs/sphinx_doc/source/tutorial/103-example.md Outdated Show resolved Hide resolved
docs/sphinx_doc/source/tutorial/104-usecase.md Outdated Show resolved Hide resolved
src/agentscope/models/model.py Show resolved Hide resolved
src/agentscope/models/openai_model.py Outdated Show resolved Hide resolved
src/agentscope/models/openai_model.py Outdated Show resolved Hide resolved
src/agentscope/models/openai_model.py Outdated Show resolved Hide resolved
src/agentscope/models/openai_model.py Show resolved Hide resolved
@DavdGao DavdGao requested a review from ZiTao-Li February 5, 2024 05:16
Copy link
Collaborator

@DavdGao DavdGao left a comment

Choose a reason for hiding this comment

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

plz see inline comments

README.md Outdated Show resolved Hide resolved
src/agentscope/models/openai_model.py Outdated Show resolved Hide resolved
src/agentscope/models/openai_model.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@DavdGao DavdGao left a comment

Choose a reason for hiding this comment

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

LGTM, please run the examples (e.g. conversation, werewolf) to ensure normal running after modification.

docs/sphinx_doc/source/agentscope.models.rst Outdated Show resolved Hide resolved
Copy link
Collaborator

@DavdGao DavdGao left a comment

Choose a reason for hiding this comment

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

LGTM

@DavdGao DavdGao merged commit 981ae7c into modelscope:main Feb 19, 2024
3 checks passed
rayrayraykk pushed a commit that referenced this pull request Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants