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 3 times, most recently from 2b7dc8c to 7b0c6f4 Compare November 10, 2025 13:44
@gustavocidornelas gustavocidornelas requested review from gustavocidornelas and removed request for whoseoyster November 11, 2025 11:41
@gustavocidornelas
Copy link
Contributor

@viniciusdsmello, can you fix the conflicts that appeared now that we merged the responses API support?

Thanks!

@viniciusdsmello viniciusdsmello force-pushed the cursor/add-tracing-for-openai-chat-completions-parse-93b9 branch 3 times, most recently from 4c52e64 to 233c132 Compare November 11, 2025 14:57
@viniciusdsmello viniciusdsmello force-pushed the cursor/add-tracing-for-openai-chat-completions-parse-93b9 branch from 233c132 to 2499112 Compare November 11, 2025 15:13
@gustavocidornelas gustavocidornelas merged commit 47c4487 into main Nov 11, 2025
5 checks passed
@gustavocidornelas gustavocidornelas deleted the cursor/add-tracing-for-openai-chat-completions-parse-93b9 branch November 11, 2025 16:48
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.

3 participants