use context instead of FileRepo... done main process.

This commit is contained in:
geekan 2024-01-05 10:56:48 +08:00
parent 57581bbb36
commit 7cae857203
9 changed files with 53 additions and 35 deletions

View file

@ -13,20 +13,20 @@ from semantic_kernel.connectors.ai.open_ai.services.open_ai_chat_completion impo
OpenAIChatCompletion,
)
from metagpt.config import CONFIG
from metagpt.config2 import config
def make_sk_kernel():
kernel = sk.Kernel()
if CONFIG.OPENAI_API_TYPE == "azure":
if llm := config.get_openai_llm():
kernel.add_chat_service(
"chat_completion",
AzureChatCompletion(CONFIG.DEPLOYMENT_NAME, CONFIG.OPENAI_BASE_URL, CONFIG.OPENAI_API_KEY),
AzureChatCompletion(llm.model, llm.base_url, llm.api_key),
)
else:
kernel.add_chat_service(
"chat_completion",
OpenAIChatCompletion(CONFIG.OPENAI_API_MODEL, CONFIG.OPENAI_API_KEY),
OpenAIChatCompletion(llm.model, llm.api_key),
)
return kernel