Skip to content

Conversation

@viniciusdsmello
Copy link
Contributor

@viniciusdsmello viniciusdsmello commented Oct 15, 2025

Pull Request

Summary

Adds comprehensive tracing support for OpenAI Chat Completions parse method, enabling monitoring of structured outputs (Pydantic models, JSON Schema).

Changes

  • Implemented tracing for synchronous and asynchronous client.chat.completions.parse calls.
  • Added parse_structured_output_data to correctly extract and serialize structured outputs.

Context

OpenAI's parse method is designed for generating structured outputs, which differs from the unstructured text returned by the create method. This PR ensures that applications leveraging the parse method for structured data extraction can also benefit from Openlayer's tracing capabilities, capturing the structured output and relevant metadata for monitoring and debugging.

Testing

  • Unit tests

Open in Cursor Open in Web

@cursor
Copy link

cursor bot commented Oct 15, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@viniciusdsmello viniciusdsmello changed the title Add tracing for openai chat completions parse [OPEN-7544] Adds support to OpenAI Chat Completions Parse call Oct 15, 2025
@viniciusdsmello viniciusdsmello force-pushed the cursor/add-tracing-for-openai-chat-completions-parse-93b9 branch from 79002a8 to b707641 Compare October 17, 2025 20:02
@viniciusdsmello viniciusdsmello marked this pull request as ready for review November 4, 2025 21:34
@viniciusdsmello viniciusdsmello self-assigned this Nov 4, 2025
@viniciusdsmello viniciusdsmello added the enhancement New feature or request label Nov 4, 2025
@viniciusdsmello viniciusdsmello force-pushed the cursor/add-tracing-for-openai-chat-completions-parse-93b9 branch 2 times, most recently from 2fd81a5 to 2b7dc8c Compare November 10, 2025 13:32
@viniciusdsmello viniciusdsmello force-pushed the cursor/add-tracing-for-openai-chat-completions-parse-93b9 branch from 2b7dc8c to 7b0c6f4 Compare November 10, 2025 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants