Skip to content

Conversation

@qbc2016
Copy link
Member

@qbc2016 qbc2016 commented Aug 18, 2025

AgentScope Version

1.0.0

Description

As the title says.

Checklist

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

  • Code has been formatted with pre-commit run --all-files command
  • All tests are passing
  • Docstrings are in Google style
  • Related documentation has been updated (e.g. links, examples, etc.)
  • Code is ready for review

@DavdGao DavdGao requested a review from Copilot August 19, 2025 11:37
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements model structured output functionality and adds comprehensive model tests for multiple chat model implementations including OpenAI, Ollama, Gemini, DashScope, and Anthropic.

Key changes:

  • Added structured_model parameter to all chat models to enable structured output generation using Pydantic BaseModel schemas
  • Added metadata field to ChatResponse class to store structured output data
  • Implemented comprehensive unit tests for all model classes covering various scenarios including streaming, tool usage, and structured output

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/model_openai_test.py Complete test suite for OpenAI chat model
tests/model_ollama_test.py Complete test suite for Ollama chat model
tests/model_gemini_test.py Complete test suite for Gemini chat model
tests/model_dashscope_test.py Complete test suite for DashScope chat model
tests/model_anthropic_test.py Complete test suite for Anthropic chat model
src/agentscope/model/_model_response.py Added metadata field to ChatResponse class
src/agentscope/model/_openai_model.py Implemented structured output support for OpenAI models
src/agentscope/model/_ollama_model.py Implemented structured output support for Ollama models
src/agentscope/model/_gemini_model.py Implemented structured output support for Gemini models
src/agentscope/model/_dashscope_model.py Implemented structured output support for DashScope models
src/agentscope/model/_anthropic_model.py Implemented structured output support for Anthropic models
src/agentscope/_utils/_common.py Added utility function to create tools from Pydantic BaseModel
.github/workflows/unittest.yml Updated CI to use dev dependencies instead of full

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@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.

Please see inline comments, and remove the unnecessary unittests to keep the code clean and tidy

Copy link
Member

@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 linked an issue Aug 23, 2025 that may be closed by this pull request
3 tasks
@DavdGao DavdGao merged commit 380d8e9 into agentscope-ai:main Aug 26, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve the current chat model implementation

2 participants