|
15 | 15 | from camel.agents import ChatAgent |
16 | 16 | from camel.configs import ChatGPTConfig |
17 | 17 | from camel.models import ModelFactory |
| 18 | +from camel.toolkits import TerminalToolkit |
18 | 19 | from camel.types import ModelPlatformType, ModelType |
19 | 20 |
|
| 21 | +tools = [ |
| 22 | + *TerminalToolkit().get_tools(), |
| 23 | +] |
| 24 | + |
20 | 25 | gpt_5_model = ModelFactory.create( |
21 | 26 | model_platform=ModelPlatformType.OPENAI, |
22 | | - model_type=ModelType.GPT_5, |
| 27 | + model_type=ModelType.GPT_5_2, |
23 | 28 | model_config_dict=ChatGPTConfig().as_dict(), |
24 | 29 | ) |
25 | 30 |
|
26 | 31 | # Set agent |
27 | | -camel_agent = ChatAgent(model=gpt_5_model) |
| 32 | +camel_agent = ChatAgent(model=gpt_5_model, tools=tools) |
28 | 33 |
|
29 | 34 | # Set user message |
30 | | -user_msg = """Say hi to CAMEL AI, one open-source community |
31 | | - dedicated to the study of autonomous and communicative agents.""" |
| 35 | +user_msg = """Use tool to create an interactive HTML webpage that allows users |
| 36 | +to play with a Rubik's Cube, and saved it to local file. |
| 37 | +""" |
32 | 38 |
|
33 | 39 | # Get response information |
34 | 40 | response = camel_agent.step(user_msg) |
35 | 41 | print(response.msgs[0].content) |
36 | 42 | ''' |
37 | 43 | =============================================================================== |
38 | | -Hello, CAMEL AI! Great to connect with an open-source community advancing |
39 | | -autonomous and communicative agents. Wishing you continued success—excited to |
40 | | -see what you build next! |
| 44 | +Created an interactive Rubik's Cube webpage and saved it locally as: |
| 45 | +
|
| 46 | +- `rubiks_cube.html` |
| 47 | +
|
| 48 | +It includes: |
| 49 | +- 3D cube rendering (drag to orbit, wheel to zoom) |
| 50 | +- Face turns via buttons or keyboard (U/D/L/R/F/B, Shift for prime) |
| 51 | +- Scramble, reset, random move |
| 52 | +- Undo/redo |
| 53 | +- Copyable moves log |
| 54 | +
|
| 55 | +Open it by double-clicking the file or serving it locally |
| 56 | +(recommended due to browser module/security policies): |
| 57 | +
|
| 58 | +```bash |
| 59 | +python3 -m http.server |
| 60 | +# then visit http://localhost:8000/rubiks_cube.html |
| 61 | +``` |
| 62 | +
|
| 63 | +If you want a **fully offline** version (no CDN usage), tell me and |
| 64 | +I'll modify it to bundle the required libraries locally or inline them. |
41 | 65 | =============================================================================== |
42 | 66 | ''' |
0 commit comments