Spaces:
Runtime error
Runtime error
| from src.interfaces.base import PerceptionEngine, MemoryManager | |
| from src.core.graph import create_agent_graph | |
| class VideoAgent: | |
| def __init__(self, perception: PerceptionEngine, memory: MemoryManager): | |
| self.graph = create_agent_graph(perception, memory) | |
| self.context = {} # Scout/Index injection | |
| def ask(self, question: str, video_id: str) -> str: | |
| """ | |
| Runs the Linear Pipeline. | |
| """ | |
| initial_state = { | |
| "query": question, | |
| "video_id": video_id, | |
| "plan": "", | |
| "search_term": "", | |
| "timestamps": [], | |
| "observations": [], | |
| "final_answer": "", | |
| "context": self.context | |
| } | |
| final_state = self.graph.invoke(initial_state) | |
| return final_state["final_answer"] | |