Add dev stacks
This commit is contained in:
17
stacks/mllogwatcher/testing.py
Executable file
17
stacks/mllogwatcher/testing.py
Executable file
@@ -0,0 +1,17 @@
|
||||
# pip install -qU langchain "langchain[anthropic]"
|
||||
from langchain.agents import create_agent
|
||||
|
||||
def get_weather(city: str) -> str:
|
||||
"""Get weather for a given city."""
|
||||
return f"It's always sunny in {city}!"
|
||||
|
||||
agent = create_agent(
|
||||
model="claude-sonnet-4-5-20250929",
|
||||
tools=[get_weather],
|
||||
system_prompt="You are a helpful assistant",
|
||||
)
|
||||
|
||||
# Run the agent
|
||||
agent.invoke(
|
||||
{"messages": [{"role": "user", "content": "what is the weather in sf"}]}
|
||||
)
|
||||
Reference in New Issue
Block a user