hzm commited on
Commit
2a95e5c
·
1 Parent(s): 7869507

update the naming from WebToolkit to BrowserToolkit in new version and add Azure OpenAI configuration to the app_en.py.

Browse files
Files changed (3) hide show
  1. owl/.env_template +4 -4
  2. owl/app_en.py +30 -0
  3. owl/run_azure_openai.py +2 -2
owl/.env_template CHANGED
@@ -5,10 +5,10 @@
5
  # OPENAI_API_BASE_URL=""
6
 
7
  # Azure OpenAI API
8
- AZURE_OPENAI_BASE_URL=""
9
- AZURE_API_VERSION=""
10
- AZURE_OPENAI_API_KEY=""
11
- AZURE_DEPLOYMENT_NAME=""
12
 
13
 
14
  # Qwen API (https://help.aliyun.com/zh/model-studio/developer-reference/get-api-key)
 
5
  # OPENAI_API_BASE_URL=""
6
 
7
  # Azure OpenAI API
8
+ # AZURE_OPENAI_BASE_URL=""
9
+ # AZURE_API_VERSION=""
10
+ # AZURE_OPENAI_API_KEY=""
11
+ # AZURE_DEPLOYMENT_NAME=""
12
 
13
 
14
  # Qwen API (https://help.aliyun.com/zh/model-studio/developer-reference/get-api-key)
owl/app_en.py CHANGED
@@ -40,6 +40,7 @@ SCRIPTS = {
40
  "Default": "run.py",
41
  "GAIA Roleplaying": "run_gaia_roleplaying.py",
42
  "OpenAI Compatible": "run_openai_compatiable_model.py",
 
43
  "Ollama": "run_ollama.py",
44
  "Terminal": "run_terminal.py",
45
  }
@@ -53,6 +54,7 @@ SCRIPT_DESCRIPTIONS = {
53
  "Default": "Default OWL implementation, uses OpenAI GPT-4o model and full set of tools",
54
  "GAIA Roleplaying": "GAIA benchmark implementation, used to evaluate model capabilities",
55
  "OpenAI Compatible": "Uses third-party models compatible with OpenAI API, supports custom API endpoints",
 
56
  "Ollama": "Uses Ollama API",
57
  "Terminal": "Uses local terminal to execute python files",
58
  }
@@ -74,6 +76,34 @@ ENV_GROUPS = {
74
  "required": False,
75
  "help": "Base URL for OpenAI API, optional. Set this if using a proxy or custom endpoint.",
76
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  {
78
  "name": "QWEN_API_KEY",
79
  "label": "Alibaba Cloud Qwen API Key",
 
40
  "Default": "run.py",
41
  "GAIA Roleplaying": "run_gaia_roleplaying.py",
42
  "OpenAI Compatible": "run_openai_compatiable_model.py",
43
+ "Azure OpenAI": "run_azure_openai.py",
44
  "Ollama": "run_ollama.py",
45
  "Terminal": "run_terminal.py",
46
  }
 
54
  "Default": "Default OWL implementation, uses OpenAI GPT-4o model and full set of tools",
55
  "GAIA Roleplaying": "GAIA benchmark implementation, used to evaluate model capabilities",
56
  "OpenAI Compatible": "Uses third-party models compatible with OpenAI API, supports custom API endpoints",
57
+ "Azure OpenAI": "Uses Azure OpenAI API",
58
  "Ollama": "Uses Ollama API",
59
  "Terminal": "Uses local terminal to execute python files",
60
  }
 
76
  "required": False,
77
  "help": "Base URL for OpenAI API, optional. Set this if using a proxy or custom endpoint.",
78
  },
79
+ {
80
+ "name": "AZURE_OPENAI_KEY",
81
+ "label": "Azure OpenAI API Key",
82
+ "type": "password",
83
+ "required": False,
84
+ "help": "Azure OpenAI API key for accessing Azure deployed GPT models. Get it from: https://portal.azure.com/",
85
+ },
86
+ {
87
+ "name": "AZURE_OPENAI_ENDPOINT",
88
+ "label": "Azure OpenAI Endpoint",
89
+ "type": "text",
90
+ "required": False,
91
+ "help": "Azure OpenAI service endpoint URL",
92
+ },
93
+ {
94
+ "name": "AZURE_DEPLOYMENT_NAME",
95
+ "label": "Azure OpenAI Deployment Name",
96
+ "type": "text",
97
+ "required": False,
98
+ "help": "Azure OpenAI service deployment name",
99
+ },
100
+ {
101
+ "name": "AZURE_OPENAI_VERSION",
102
+ "label": "Azure OpenAI API Version",
103
+ "type": "text",
104
+ "required": False,
105
+ "help": "Azure OpenAI API version, e.g. 2023-12-01-preview",
106
+ },
107
  {
108
  "name": "QWEN_API_KEY",
109
  "label": "Alibaba Cloud Qwen API Key",
owl/run_azure_openai.py CHANGED
@@ -20,7 +20,7 @@ from camel.toolkits import (
20
  ExcelToolkit,
21
  ImageAnalysisToolkit,
22
  SearchToolkit,
23
- WebToolkit,
24
  FileWriteToolkit,
25
  )
26
  from camel.types import ModelPlatformType
@@ -61,7 +61,7 @@ def construct_society(question: str) -> OwlRolePlaying:
61
 
62
  # Configure toolkits
63
  tools = [
64
- *WebToolkit(
65
  headless=False, # Set to True for headless mode (e.g., on remote servers)
66
  web_agent_model=models["web"],
67
  planning_agent_model=models["planning"],
 
20
  ExcelToolkit,
21
  ImageAnalysisToolkit,
22
  SearchToolkit,
23
+ BrowserToolkit,
24
  FileWriteToolkit,
25
  )
26
  from camel.types import ModelPlatformType
 
61
 
62
  # Configure toolkits
63
  tools = [
64
+ *BrowserToolkit(
65
  headless=False, # Set to True for headless mode (e.g., on remote servers)
66
  web_agent_model=models["web"],
67
  planning_agent_model=models["planning"],