Spaces:
Runtime error
Runtime error
| from agents import Agent, Runner, trace, output_guardrail, GuardrailFunctionOutput | |
| from pydantic import BaseModel, Field | |
| from typing import Dict, List | |
| from model import model | |
| INSTRUCTIONS = ( | |
| "You are a helpful research assistant. " | |
| "Given a user query, generate a set of 3 insightful questions " | |
| "to ask the user in order to facilitate detailed and in-depth planning." | |
| ) | |
| class QuestionItem(BaseModel): | |
| number: int = Field(description='Question Number') | |
| question: str = Field(description='The question text based on user query') | |
| answer: str | None = None | |
| class QuestionPlan(BaseModel): | |
| questions: list[QuestionItem] = Field(description='List of question') | |
| question_agent = Agent( | |
| name='question_agent', | |
| instructions=INSTRUCTIONS, | |
| model=model, | |
| output_type=QuestionPlan | |
| ) | |