Wendong-Fan commited on
Commit
2877668
·
2 Parent(s): 381b55d 40aab8c

Merge pull request #18 from ANGJustinl/main

Browse files

feat: Temporary support for multiple model access point configurations

Files changed (2) hide show
  1. owl/.env_template +4 -0
  2. owl/run.py +8 -6
owl/.env_template CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
 
2
  # OPENAI API
3
  OPENAI_API_KEY = ""
 
1
+ # MODEL & API (See https://github.com/camel-ai/camel/blob/master/camel/types/enums.py)
2
+ DEFAULT_MODEL_PLATFORM_TYPE = "OPENAI"
3
+ DEFAULT_MODEL_TYPE = "gpt-4o"
4
+ OPENAI_API_BASE_URL = ""
5
 
6
  # OPENAI API
7
  OPENAI_API_KEY = ""
owl/run.py CHANGED
@@ -1,10 +1,13 @@
 
 
 
1
  from camel.models import ModelFactory
2
  from camel.toolkits import *
3
  from camel.types import ModelPlatformType, ModelType
4
  from camel.configs import ChatGPTConfig
5
 
6
  from typing import List, Dict
7
- from dotenv import load_dotenv
8
  from retry import retry
9
  from loguru import logger
10
 
@@ -12,7 +15,6 @@ from utils import OwlRolePlaying, run_society
12
  import os
13
 
14
 
15
- load_dotenv()
16
 
17
 
18
  def construct_society(question: str) -> OwlRolePlaying:
@@ -22,14 +24,14 @@ def construct_society(question: str) -> OwlRolePlaying:
22
  assistant_role_name = "assistant"
23
 
24
  user_model = ModelFactory.create(
25
- model_platform=ModelPlatformType.OPENAI,
26
- model_type=ModelType.GPT_4O,
27
  model_config_dict=ChatGPTConfig(temperature=0, top_p=1).as_dict(), # [Optional] the config for model
28
  )
29
 
30
  assistant_model = ModelFactory.create(
31
- model_platform=ModelPlatformType.OPENAI,
32
- model_type=ModelType.GPT_4O,
33
  model_config_dict=ChatGPTConfig(temperature=0, top_p=1).as_dict(), # [Optional] the config for model
34
  )
35
 
 
1
+ from dotenv import load_dotenv
2
+ load_dotenv()
3
+
4
  from camel.models import ModelFactory
5
  from camel.toolkits import *
6
  from camel.types import ModelPlatformType, ModelType
7
  from camel.configs import ChatGPTConfig
8
 
9
  from typing import List, Dict
10
+
11
  from retry import retry
12
  from loguru import logger
13
 
 
15
  import os
16
 
17
 
 
18
 
19
 
20
  def construct_society(question: str) -> OwlRolePlaying:
 
24
  assistant_role_name = "assistant"
25
 
26
  user_model = ModelFactory.create(
27
+ model_platform=ModelPlatformType.DEFAULT,
28
+ model_type=ModelType.DEFAULT,
29
  model_config_dict=ChatGPTConfig(temperature=0, top_p=1).as_dict(), # [Optional] the config for model
30
  )
31
 
32
  assistant_model = ModelFactory.create(
33
+ model_platform=ModelPlatformType.DEFAULT,
34
+ model_type=ModelType.DEFAULT,
35
  model_config_dict=ChatGPTConfig(temperature=0, top_p=1).as_dict(), # [Optional] the config for model
36
  )
37