Skip to content

[Bug]: Streams not logged to Opik when using LLamaIndex integration #1743

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

Closed
2 of 4 tasks
Pratham271 opened this issue Apr 4, 2025 · 7 comments · Fixed by #1769
Closed
2 of 4 tasks

[Bug]: Streams not logged to Opik when using LLamaIndex integration #1743

Pratham271 opened this issue Apr 4, 2025 · 7 comments · Fixed by #1769
Assignees

Comments

@Pratham271
Copy link

Pratham271 commented Apr 4, 2025

What component(s) are affected?

  • Python SDK
  • Opik UI
  • Opik Server
  • Documentation

Opik version

  • Opik version: 1.6.12

Describe the problem

I am using the following code to log the traces of my llama app
but it logs the traces for .chat method of llama but not for stream_chat function it is showing me nothing in the output for that

Reproduction steps and code snippets

this is how I am setting up configuration for llama and opik:

@asynccontextmanager
async def app_lifespan(_app: FastAPI):
    from bson import ObjectId

    # Encodes `ObjectId` class as `str`
    ENCODERS_BY_TYPE.update({ObjectId: str})

    # Configure Opik to Log traces and prompt management
    opik.configure()
    opik_callback_handler = LlamaIndexCallbackHandler()
    Settings.callback_manager = CallbackManager([opik_callback_handler])
    yield

Error logs or stack trace

No response

Healthcheck results

No response

@jverre
Copy link
Collaborator

jverre commented Apr 4, 2025

@Lothiraldan Can you take a look

@jverre jverre changed the title [Bug]: [Bug]: Streams not logged to Opik when using LLamaIndex integration Apr 4, 2025
@Lothiraldan
Copy link
Member

Hi @Pratham271, I was able to reproduce the bug and I'm working on fixing it. Thank you for opening an issue!

@Pratham271
Copy link
Author

@Lothiraldan any update on this

@Lothiraldan
Copy link
Member

@Pratham271 Yes, I've been able to understand the root cause of the issue. Solving it turns out to be a bit more complicated than anticipated but we have a clear plan now. I'm hoping to have it finished by tomorrow.

@Pratham271
Copy link
Author

@Lothiraldan Thank you

@Lothiraldan
Copy link
Member

@Pratham271 I just merged a PR to add support for it, can you give it a try? You will need to install the Python SDK from a Git checkout or wait for the next release, let me know if you need help with instructions

@Pratham271
Copy link
Author

@Lothiraldan I will try it and let you know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants