8000 Add files via upload · strands-agents/sdk-python@2137064 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2137064

Browse files
Add files via upload
vLLM Model Provider Integration tests
1 parent 6bab061 commit 2137064

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

tests-integ/test_model_vllm.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import pytest
2+
import strands
3+
from strands import Agent
4+
from strands.models.vllm import VLLMModel
5+
6+
7+
@pytest.fixture
8+
def model():
9+
return VLLMModel(
10+
model_id="meta-llama/Llama-3.2-3B", # or whatever your model ID is
11+
host="http://localhost:8000", # adjust as needed
12+
max_tokens=128,
13+
)
14+
15+
16+
@pytest.fixture
17+
def tools():
18+
@strands.tool
19+
def tool_time() -> str:
20+
return "12:00"
21+
22+
@strands.tool
23+
def tool_weather() -> str:
24+
return "cloudy"
25+
26+
return [tool_time, tool_weather]
27+
28+
29+
@pytest.fixture
30+
def agent(model, tools):
31+
return Agent(model=model, tools=tools)
32+
33+
34+
def test_agent(agent):
35+
result = agent("What is the time and weather in Melboune Australia?")
36+
text = result.message["content"][0]["text"].lower()
37+
38+
assert all(string in text for string in ["3:00", "cloudy"])

0 commit comments

Comments
 (0)
0