Merge pull request #18 from ANGJustinl/main

feat: Temporary support for multiple model access point configurations
This commit is contained in:
Wendong-Fan
2025-03-07 21:41:30 +08:00
committed by GitHub
2 changed files with 12 additions and 6 deletions

View File

@@ -1,3 +1,7 @@
# MODEL & API (See https://github.com/camel-ai/camel/blob/master/camel/types/enums.py)
DEFAULT_MODEL_PLATFORM_TYPE = "OPENAI"
DEFAULT_MODEL_TYPE = "gpt-4o"
OPENAI_API_BASE_URL = ""
# OPENAI API
OPENAI_API_KEY = ""

View File

@@ -1,10 +1,13 @@
from dotenv import load_dotenv
load_dotenv()
from camel.models import ModelFactory
from camel.toolkits import *
from camel.types import ModelPlatformType, ModelType
from camel.configs import ChatGPTConfig
from typing import List, Dict
from dotenv import load_dotenv
from retry import retry
from loguru import logger
@@ -12,7 +15,6 @@ from utils import OwlRolePlaying, run_society
import os
load_dotenv()
def construct_society(question: str) -> OwlRolePlaying:
@@ -22,14 +24,14 @@ def construct_society(question: str) -> OwlRolePlaying:
assistant_role_name = "assistant"
user_model = ModelFactory.create(
model_platform=ModelPlatformType.OPENAI,
model_type=ModelType.GPT_4O,
model_platform=ModelPlatformType.DEFAULT,
model_type=ModelType.DEFAULT,
model_config_dict=ChatGPTConfig(temperature=0, top_p=1).as_dict(), # [Optional] the config for model
)
assistant_model = ModelFactory.create(
model_platform=ModelPlatformType.OPENAI,
model_type=ModelType.GPT_4O,
model_platform=ModelPlatformType.DEFAULT,
model_type=ModelType.DEFAULT,
model_config_dict=ChatGPTConfig(temperature=0, top_p=1).as_dict(), # [Optional] the config for model
)