You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@RogerThomas, thanks for providing the example snippet, but i haven't been able to reproduce your error by
installing the environment you've provided
creating a fast api route
calling get_descriptions(llm) within the fast api route
Are you running into this error consistently? Our integration doesn't add data to request headers as the 431 error suggests so we'll need some more details about this error to investigate this further.
It looks like the error is being raised by:
descriptions = await asyncio.gather(
*(
chain.ainvoke({"image_base64": _convert_image_to_base64_string(image)})
for image in (image0, image1, image2)
)
)
Could you not wrap this with:
try:
descriptions = await asyncio.gather(
*(
chain.ainvoke({"image_base64": _convert_image_to_base64_string(image)})
for image in (image0, image1, image2)
)
)
except openai.APIStatusError as e:
print("Another non-200-range status code was received")
print(e.status_code)
print(e.response)
Summary of problem
Async requests with vision returns a 431 from openai
I have confirmed this only happens when using datadog as when I replace this
with
It doesn't happen.
When I run the
get_descriptions
from a fastapi routeI get
This doesn't seem to happen with the non azure chat, i.e.
ChatOpenAI
doesn't seem to have this issueWhich version of dd-trace-py are you using?
ddtrace==2.11.1
Which version of pip are you using?
Not using pip, using uv
uv --version
uv 0.3.4 (Homebrew 2024-08-26)
Which libraries and their versions are you using?
How can we reproduce your problem?
Create a fastapi route and run the above
What is the result that you get?
Error is above
What is the result that you expected?
No error
The text was updated successfully, but these errors were encountered: