Skip to content

Commit 6e01599

Browse files
committed
update mistral example code
1 parent 5c6edec commit 6e01599

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

examples/run_mistral.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
from camel.toolkits import FunctionTool
8383
from camel.types import ModelPlatformType, ModelType
8484
from camel.logger import set_log_level
85-
from camel.toolkits import MCPToolkit
85+
from camel.toolkits import MCPToolkit, FileWriteToolkit, CodeExecutionToolkit
8686
from camel.societies import RolePlaying
8787

8888
from owl.utils.enhanced_role_playing import arun_society
@@ -109,7 +109,7 @@ async def construct_society(
109109
models = {
110110
"user": ModelFactory.create(
111111
model_platform=ModelPlatformType.MISTRAL,
112-
model_type=ModelType.MISTRAL_LARGE,
112+
model_type=ModelType.MISTRAL_MEDIUM_3,
113113
model_config_dict={"temperature": 0},
114114
),
115115
"assistant": ModelFactory.create(
@@ -149,17 +149,21 @@ async def main():
149149

150150
# Default task
151151
default_task = (
152-
"I'd like a academic report about Andrew Ng, including "
153-
"his research direction, published papers (At least 3), "
154-
"institutions, etc. You have been provided with tools to do "
155-
"browser operation. Open browser to finish the task."
152+
"Help me search the latest reports about smart city, "
153+
"summarize them and help me generate a PDF file. You have "
154+
"been provided with tools to do browser operation. Open "
155+
"browser to finish the task."
156156
)
157157

158158
# Override default task if command line argument is provided
159159
task = sys.argv[1] if len(sys.argv) > 1 else default_task
160160

161-
# Connect to all MCP toolkits
162-
tools = [*mcp_toolkit.get_tools()]
161+
# Connect to toolkits
162+
tools = [
163+
*mcp_toolkit.get_tools(),
164+
*FileWriteToolkit().get_tools(),
165+
*CodeExecutionToolkit().get_tools(),
166+
]
163167
society = await construct_society(task, tools)
164168
answer, chat_history, token_count = await arun_society(society)
165169
print(f"\033[94mAnswer: {answer}\033[0m")

0 commit comments

Comments
 (0)