优化autogen的使用

This commit is contained in:
binary-husky
2023-10-23 01:56:18 +08:00
parent e2b3c47186
commit 27c4e3ef4f
9 changed files with 108 additions and 54 deletions

View File

@@ -314,7 +314,10 @@ def generate_payload(inputs, llm_kwargs, history, system_prompt, stream):
what_i_ask_now["role"] = "user"
what_i_ask_now["content"] = inputs
messages.append(what_i_ask_now)
model = llm_kwargs['llm_model'].strip('api2d-')
model = llm_kwargs['llm_model']
if llm_kwargs['llm_model'].startswith('api2d-'):
model = llm_kwargs['llm_model'][len('api2d-'):]
if model == "gpt-3.5-random": # 随机选择, 绕过openai访问频率限制
model = random.choice([
"gpt-3.5-turbo",