Skip to content

Commit 7e49aca

Browse files
committed
♻️ refactor(example): reorganize dotenv loading and spacing
- move dotenv loading closer to imports for better readability - adjust spacing to improve code organization and clarity
1 parent 2997131 commit 7e49aca

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

examples/cicada_tool_usage_example.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22
import os
33
from pprint import pprint
44

5-
from dotenv import load_dotenv
6-
7-
# Load environment variables from .env file
8-
load_dotenv()
9-
105
# pip install cicada-agent
116
from cicada.core.model import MultiModalModel
127
from cicada.core.utils import cprint
8+
from dotenv import load_dotenv
139

1410
from toolregistry import ToolRegistry
1511
from toolregistry.hub import UnitConverter
1612

13+
# Load environment variables from .env file
14+
load_dotenv()
15+
1716
model_name = os.getenv("MODEL", "deepseek-v3")
1817
stream = os.getenv("STREAM", "True").lower() == "true" # Configurable stream option
1918

@@ -29,11 +28,13 @@
2928

3029
tool_registry = ToolRegistry()
3130

31+
3232
# register tools
3333
@tool_registry.register
3434
def get_weather(location: str):
3535
return f"Weather in {location}: Sunny, 25°C"
3636

37+
3738
# @tool_registry.register
3839
# def c_to_f(celsius: float) -> float:
3940
# fahrenheit = (celsius * 1.8) + 32

0 commit comments

Comments
 (0)