mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-07-02 16:01:04 +02:00
fixbug: Fix the confusion caused by the merging of _client, client, and async_client in the openai_api.py;Split Azure LLM and MetaGPT LLM from OpenAI LLM to reduce the number of variables defined in the Config class for compatibility.
This commit is contained in:
parent
4b4ccc60fc
commit
a90f52d4b6
8 changed files with 143 additions and 161 deletions
|
|
@ -18,15 +18,15 @@ from metagpt.config import CONFIG
|
|||
|
||||
def make_sk_kernel():
|
||||
kernel = sk.Kernel()
|
||||
if CONFIG.openai_api_type == "azure":
|
||||
if CONFIG.OPENAI_API_TYPE == "azure":
|
||||
kernel.add_chat_service(
|
||||
"chat_completion",
|
||||
AzureChatCompletion(CONFIG.deployment_name, CONFIG.openai_base_url, CONFIG.openai_api_key),
|
||||
AzureChatCompletion(CONFIG.DEPLOYMENT_NAME, CONFIG.OPENAI_BASE_URL, CONFIG.OPENAI_API_KEY),
|
||||
)
|
||||
else:
|
||||
kernel.add_chat_service(
|
||||
"chat_completion",
|
||||
OpenAIChatCompletion(CONFIG.openai_api_model, CONFIG.openai_api_key),
|
||||
OpenAIChatCompletion(CONFIG.OPENAI_API_MODEL, CONFIG.OPENAI_API_KEY),
|
||||
)
|
||||
|
||||
return kernel
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue