Spaces:
Runtime error
Runtime error
Download src/agents/generic_agent.py from simonlee-cb/chat-image-edit: direct link, hf CLI and curl.
- Browser
- Download file 399 Bytes
-
https://huggingface.co/spaces/simonlee-cb/chat-image-edit/resolve/main/src/agents/generic_agent.py
- Command line
-
hf download hf://spaces/simonlee-cb/chat-image-edit/src/agents/generic_agent.py
-
curl -L -o generic_agent.py https://huggingface.co/spaces/simonlee-cb/chat-image-edit/resolve/main/src/agents/generic_agent.py
399 Bytes
| from pydantic_ai import Agent | |
| from pydantic_ai.models.openai import OpenAIModel | |
| from dotenv import load_dotenv | |
| import os | |
| load_dotenv() | |
| model = OpenAIModel("gpt-4o", api_key=os.environ.get("OPENAI_API_KEY")) | |
| system_prompt = """ | |
| You are a helpful assistant that can answer questions and help with tasks. | |
| """ | |
| generic_agent = Agent( | |
| model=model, | |
| system_prompt=system_prompt, | |
| tools=[], | |
| ) | |