Spaces:
Sleeping
Sleeping
Download agents/sequence_agent.py from dharu007/ArtifaXChatBot: direct link, hf CLI and curl.
- Browser
- Download file 717 Bytes
-
https://huggingface.co/spaces/dharu007/ArtifaXChatBot/resolve/main/agents/sequence_agent.py
- Command line
-
hf download hf://spaces/dharu007/ArtifaXChatBot/agents/sequence_agent.py
-
curl -L -o sequence_agent.py https://huggingface.co/spaces/dharu007/ArtifaXChatBot/resolve/main/agents/sequence_agent.py
717 Bytes
| import json | |
| import os | |
| import sys | |
| sys.path.append(os.path.dirname(os.path.dirname(__file__))) | |
| from ai_client import AIClient | |
| class SequenceAgent: | |
| def __init__(self): | |
| self.config = self.load_config() | |
| def load_config(self): | |
| config_path = os.path.join('config', 'sequence_agent_config.json') | |
| with open(config_path, 'r') as f: | |
| return json.load(f) | |
| def process(self, process_flow): | |
| system_prompt = self.config['system_prompt'] | |
| instructions = '\n'.join(self.config['instructions']) | |
| full_prompt = f"{system_prompt}\n\n{instructions}" | |
| ai_client = AIClient() | |
| return ai_client.generate_response(full_prompt, process_flow) |