-
Notifications
You must be signed in to change notification settings - Fork 309
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
Implement model-oriented format function in OpenAI and Post API chat wrapper #381
Conversation
…ugs in previous format function, where the conversation maybe empty; Modify unit test accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see the inline comments.
# Conflicts: # src/agentscope/models/gemini_model.py # src/agentscope/models/model.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
自己定义的模型包装器,发现里面就是启动一个参数传参的功能,里面也没有流式,自己写根本就无法起作用,我在里面判断请求方式,自己加stream,发现他根本就不起作用,而且,即便是删除reque_argwargs后面的所有代码,也不影响,即便是有错误,也不会有什么用,这个自定义的模型包装器,到底怎么定义,我只能非流式传输,流式的安装openai改了判断stream,使用迭代器,发现根本就不起作用,也不报错,始终是非流式输出#!/usr/bin/env python -- coding:utf-8 --@time : 2024/8/28 9:54@file : local_model.pyfrom abc import ABC from agentscope.models import ModelWrapperBase
class GewuAPIChatWrapper(GewuModelWrapper):
if name == 'main':
|
Background
Considering the PostAIChatWrapper will be used for many different models (e.g. gpt-4, gemini, glm-4, and so on), and OpenAI API can be used for different model services, we should choose prompt strategies in both OpenAIChatWrapper and PostAPIChatWrapper according to the model name.
Description
format_for_common_chat_models
inModelWrapperBase
class;In this PR, we modified into to
Checklist
Please check the following items before code is ready to be reviewed.