修改语言判断调用的方法
This commit is contained in:
@@ -200,6 +200,18 @@ def get_response(messages):
|
||||
return response
|
||||
|
||||
|
||||
def get_assistant_response(messages):
|
||||
response = Generation.call(
|
||||
model='qwen-max',
|
||||
api_key=QWEN_API_KEY,
|
||||
messages=messages,
|
||||
# seed=random.randint(1, 10000), # 设置随机数种子seed,如果没有设置,则随机数种子默认为1234
|
||||
result_format='message', # 将输出设置为message形式
|
||||
enable_search='false'
|
||||
)
|
||||
return response
|
||||
|
||||
|
||||
def call_with_messages(message, gender):
|
||||
global tool_info
|
||||
user_input = message
|
||||
@@ -329,7 +341,7 @@ def get_language(message: str) -> str:
|
||||
}
|
||||
]
|
||||
|
||||
first_response = get_response(messages)
|
||||
first_response = get_assistant_response(messages)
|
||||
assistant_output = first_response.output.choices[0].message.content
|
||||
logging.info(f"大模型输出信息:{first_response}\n判断用户输入的语言为:{assistant_output}")
|
||||
# print(f"大模型输出信息:{first_response}\n判断用户输入的语言为:{assistant_output}")
|
||||
|
||||
Reference in New Issue
Block a user