Skip to content

Deduplicate logic for getting request model in openai-agents #6415

@alexander-alderman-webb

Description

Remove duplication between

if agent.model:
model_name = agent.model.model if hasattr(agent.model, "model") else agent.model
elif hasattr(agent, "_sentry_request_model"):
model_name = agent._sentry_request_model

and

if agent.model:
model_name = agent.model.model if hasattr(agent.model, "model") else agent.model
elif hasattr(agent, "_sentry_request_model"):
model_name = agent._sentry_request_model

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions