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

[Bug]: Langfuse integration: error generated in logging handler - dictionary changed size during iteration #7675

Open
ngamolsky opened this issue Jan 10, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@ngamolsky
Copy link

ngamolsky commented Jan 10, 2025

What happened?

I get errors generated from the langfuse logging handler.

This is very similar to fixed issue here: #2245

I believe we just need to remove the response obj if we are to follow the same pattern.

Relevant log output

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/litellm/integrations/langfuse/langfuse.py", line 260, in log_event
    print_verbose(f"OUTPUT IN LANGFUSE: {output}; original: {response_obj}")
                                                            ^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/_models.py", line 199, in __str__
    return f'{self.__repr_name__()}({self.__repr_str__(", ")})'  # type: ignore[misc]
                                     ^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/pydantic/_internal/_repr.py", line 56, in __repr_str__
    return join_str.join(repr(v) if a is None else f'{a}={v!r}' for a, v in self.__repr_args__())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/pydantic/_internal/_repr.py", line 56, in <genexpr>
    return join_str.join(repr(v) if a is None else f'{a}={v!r}' for a, v in self.__repr_args__())
                                                                            ^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/pydantic/main.py", line 1026, in __repr_args__
    for k, v in self.__dict__.items():
                ^^^^^^^^^^^^^^^^^^^^^
RuntimeError: dictionary changed size during iteration

Are you a ML Ops Team?

No

What LiteLLM version are you on ?

v1.58.0

Twitter / LinkedIn details

No response

@ngamolsky ngamolsky added the bug Something isn't working label Jan 10, 2025
@ngamolsky ngamolsky changed the title [Bug]: Langufuse integration: error generated in logging handler - dictionary changed size during iteration [Bug]: Langfuse integration: error generated in logging handler - dictionary changed size during iteration Jan 10, 2025
@krrishdholakia
Copy link
Contributor

is this still an issue? @ngamolsky

cc: @ishaan-jaff

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

No branches or pull requests

2 participants