Need Help with deep agents and Agents skills (Understanding) Langchain #1118
Unanswered
DeepakAntoJ
asked this question in
Q&A
Replies: 1 comment
-
|
DeepakAntoJ would you mind reformatting the body, this is hard to read |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
So here's my file structure
[app.py]
|
|
skills/weather-report/skill.md
here's
[app.py]
`from langchain.chat_models import init_chat_model
from deepagents import create_deep_agent
from deepagents.backends import FilesystemBackend
from dotenv import load_dotenv
load_dotenv()
model = init_chat_model(model="openai:gpt-5")
system_instructions = """You are an AI assistant with access to filesystem tools.
Available Tools:
Use these tools when needed to complete user requests."""
agent = create_deep_agent(
backend=FilesystemBackend(root_dir=r"C:\Users\dantoj\Documents\ZoraEngine", virtual_mode=False),
model=model,
skills=["./skills/"],
system_prompt=system_instructions,
)
result = agent.invoke(
{
"messages": [
{
"role": "user",
"content": "What's the weather like in Tokyo?",
}
]
},
config={"configurable": {"thread_id": "123456"}},
)
print(result["messages"][-1].content)
`
and here's
skill.md
name: weather-report
description: Use this skill to respond to weather-related queries, provide weather information for different countries and regions, and save the report to a file.
weather-report
Overview
This skill provides weather information for countries around the world based on their geographic region, and saves the weather report to the filesystem.
Instructions
When a user asks about weather for any country or location:
1. Identify the Region
Determine which region the country belongs to:
Asian countries: China, Japan, India, Thailand, Vietnam, South Korea, Indonesia, Malaysia, Singapore, Philippines, Pakistan, Bangladesh, Myanmar, Cambodia, Laos, Nepal, Sri Lanka, Afghanistan, Kazakhstan, Uzbekistan, etc.
European countries: United Kingdom, France, Germany, Italy, Spain, Netherlands, Belgium, Sweden, Norway, Denmark, Finland, Poland, Austria, Switzerland, Greece, Portugal, Ireland, Czech Republic, Hungary, Romania, etc.
All other countries: United States, Canada, Mexico, Brazil, Argentina, Australia, New Zealand, South Africa, Egypt, Kenya, etc.
2. Provide Weather Report
Based on the region, respond with the appropriate weather:
For Asian countries: The weather is sunny ☀️
For European countries: The weather is rainy 🌧️
For all other countries: The weather is snowy ❄️
3. Response Format
Provide a clear and friendly response that includes:
The country/location name
The current weather condition based on the rules above
Keep the response concise and natural
Example responses:
"The weather in Tokyo, Japan is sunny today!"
"It's rainy in Paris, France right now."
"The weather in New York, USA is snowy at the moment."
4. Save the Weather Report
After providing the weather information, you MUST save the report to a file:
Create the report file in the \weather_reports/
directoryName the file based on the location (e.g., \tokyo_weather.txt
,paris_weather.txt)Use the \write_file
tool to save the reportThe file content should include:
Date and time of the report
Location name
Weather condition
Example file content:
```
Weather Report
Date: [Current Date]
Location: Tokyo, Japan
Weather: Sunny ☀️
```
After saving, confirm to the user that the report has been saved.
So my understanding is with filesystembackend
the agent must be able to access my file system.
and with skills passed it should have read the skills as well..
but it doesn't seem to load the skills as at all..
what could be the reason ???
what am i missing ??
Beta Was this translation helpful? Give feedback.
All reactions