Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Truncate span input when input is too large #260

Open
ant31 opened this issue Mar 20, 2025 · 2 comments
Open

Truncate span input when input is too large #260

ant31 opened this issue Mar 20, 2025 · 2 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@ant31
Copy link

ant31 commented Mar 20, 2025

Truncate span input when too large

Trace span input has a size limit
The whole run fails, not sending the trace should be at most a log warning:
the generation(aka cost) already happened and tracing is secondary.

I don't want to disable trace all together.
I would like to:

  1. Skip or truncate input/output automatically when too large on spans
    2. Don't raise errors but warnings, or at least have the options to ignore them (trace_ignore_errors=True)
Tracing client error 400: {
  "error": {
    "message": "Invalid 'data[0].span_data.input': data payload too large. Expected a JSON value under 100KB.",
    "type": "invalid_request_error",
    "param": "data[0].span_data.input",
    "code": null
  }
}
@ant31 ant31 added the enhancement New feature or request label Mar 20, 2025
@rm-openai
Copy link
Collaborator

Thanks, we should definitely fix this. Though that said - the run shouldn't fail, since it just logs an error (doesn't raise an Exception). Are you seeing the entire run fail?

@rm-openai rm-openai added the bug Something isn't working label Mar 20, 2025
@ant31
Copy link
Author

ant31 commented Mar 20, 2025

Ha! you're correct, I tested again and it doesn't fail the run. I'm updating the description.
thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants