Getting output structure from a model

I’m trying to get structured output from a model
I’m using model with response model:


class IssueDetails(BaseModel):
    error_message: str
    issue_details: str
    error: bool

model_to_use = "us.amazon.nova-pro-v1:0" 

class IssueTypeClassifier:
    def __init__(self, model_to_use=model_to_use):
        self.session = boto3.Session(profile_name='dev-bedrock-role', region_name='us-east-1')
        self.agent = Agent(
            model=AwsBedrock(id=model_to_use, session=self.session, temperature=0.0),
            tools=[my_tool],
            instructions=[
                "... removed "
            ],
            **response_model=IssueDetails**
        )

    def classify_issue(self, issue_key):
        response: RunResponse = self.agent.run(f"Get issue details for issue key: {issue_key}")
        dict_response = response.to_dict()
        return dict_response

but i do not get IssueDetails object fron the ‘run’ method

What do i do wrong?

hey @shai
thanks for reaching out and supporting Agno. I’ve shared this with the team, we’re working through all requests one by one and will get back to you soon.If it’s urgent, please let us know. We appreciate your patience!

Hi @shai , The model might not be using structured outputs directly , so you can use use_json_mode=True and try it .
For more details you can refer to this docs Structured outputs - Agno

yep, This should be clearer I believe in the documentation
Thanks