Skip to content

Commit 81596f7

Browse files
feat: update with pip package
1 parent 047a9e3 commit 81596f7

1 file changed

Lines changed: 12 additions & 15 deletions

File tree

example/test.py

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
1-
"""Example usage of Edgee Gateway SDK"""
1+
"""Example usage of Edgee Gateway SDK
22
3-
import os
4-
import sys
5-
6-
# Add parent directory to path for local testing
7-
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
3+
Install the package from PyPI:
4+
pip install edgee
5+
"""
86

97
from pydantic import BaseModel
108

11-
from edgee import Edgee, Tool, create_tool
12-
13-
edgee = Edgee(os.environ.get("EDGEE_API_KEY", "test-key"))
9+
from edgee import Edgee, EdgeeConfig, Tool, create_tool
1410

11+
edgee = Edgee(api_key="YOUR_API_KEY")
1512
# Test 1: Simple string input
1613
print("Test 1: Simple string input")
1714
response1 = edgee.send(
18-
model="mistral/mistral-small-latest",
15+
model="devstral2",
1916
input="What is the capital of France?",
2017
)
2118
print(f"Content: {response1.text}")
@@ -25,7 +22,7 @@
2522
# Test 2: Full input object with messages
2623
print("Test 2: Full input object with messages")
2724
response2 = edgee.send(
28-
model="mistral/mistral-small-latest",
25+
model="devstral2",
2926
input={
3027
"messages": [
3128
{"role": "system", "content": "You are a helpful assistant."},
@@ -39,7 +36,7 @@
3936
# Test 3: With tools
4037
print("Test 3: With tools")
4138
response3 = edgee.send(
42-
model="gpt-4o",
39+
model="devstral2",
4340
input={
4441
"messages": [{"role": "user", "content": "What is the weather in Paris?"}],
4542
"tools": [
@@ -67,7 +64,7 @@
6764

6865
# Test 4: Streaming
6966
print("Test 4: Streaming")
70-
for chunk in edgee.stream(model="mistral/mistral-small-latest", input="What is Python?"):
67+
for chunk in edgee.stream(model="devstral2", input="What is Python?"):
7168
if chunk.text:
7269
print(chunk.text, end="", flush=True)
7370
print("\n")
@@ -119,7 +116,7 @@ def get_weather(params: WeatherParams) -> dict:
119116

120117
# Send request with automatic tool execution
121118
response5 = edgee.send(
122-
model="gpt-4o",
119+
model="devtral2",
123120
input="What's the weather like in Paris?",
124121
tools=[weather_tool],
125122
)
@@ -161,7 +158,7 @@ def calculate(params: CalculatorParams) -> dict:
161158
)
162159

163160
response6 = edgee.send(
164-
model="gpt-4o",
161+
model="devtral2",
165162
input="What's 25 multiplied by 4, and then what's the weather in London?",
166163
tools=[weather_tool, calculator_tool],
167164
)

0 commit comments

Comments
 (0)