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

Litellm patch #2254

Merged
merged 2 commits into from
Nov 19, 2024
Merged

Litellm patch #2254

merged 2 commits into from
Nov 19, 2024

Conversation

jp-agenta
Copy link
Contributor

No description provided.

@jp-agenta jp-agenta requested a review from mmabrouk November 14, 2024 11:56
@jp-agenta jp-agenta self-assigned this Nov 14, 2024
Copy link

vercel bot commented Nov 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
agenta ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 14, 2024 0:02am
agenta-documentation ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 14, 2024 0:02am

Copy link
Member

@mmabrouk mmabrouk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think streaming would not work with the current path. See comments

@@ -89,16 +89,20 @@ def log_stream_event(
log.error("LiteLLM callback error: span not found.")
return

result = kwargs.get("complete_streaming_response")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not look like you can remove this. It seems they get the result from there in the case of streaming, no?

@@ -194,16 +198,20 @@ async def async_log_stream_event(
log.error("LiteLLM callback error: span not found.")
return

result = kwargs.get("complete_streaming_response")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Member

@mmabrouk mmabrouk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jp-agenta

Reviewed and QA'ed

As for streaming:

  • I added a test for streaming
  • Apparently the log_success gets called anyways with streaming, so no need to log each event (each chunk). I have just removed it.
  • However, all the code in the case of streaming works, it returns strange warnings
Setting attribute on ended span.
Setting attribute on ended span.
Tried calling set_status on an ended span.
Calling end() on an ended span.

I don't understand the reason. Although the sucess_event is working and logging everything correctly, somehow the otel sdk is saying we are calling things on ended spans. Not a blocker anyways (happens only in streaming)

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 19, 2024
@jp-agenta jp-agenta merged commit a3c559a into main Nov 19, 2024
10 checks passed
@jp-agenta jp-agenta deleted the litellm-patch branch November 19, 2024 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer SDK size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants