-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
If I run the following with EDOT python+Langtrace, I get only an HTTP span, but nothing from Langtrace.

from langchain_mistralai.chat_models import ChatMistralAI
# ChatMistralAI is implemented directly in Langchain using httpx, so install
# the Langchain instrumentation.
from langtrace_python_sdk.instrumentation import LangchainInstrumentation
LangchainInstrumentation().instrument()
def main():
llm = ChatMistralAI(model_name="open-mistral-nemo", streaming=True)
response_stream = llm.stream("Write a short poem on OpenTelemetry.")
for chunk in response_stream:
print(chunk.content, end="")
if __name__ == "__main__":
main()
If we had instrumentation here, we would get gen_ai spans for Mistral when used in Langchain.
Notes
- I discussed the idea of re-using the official SDK here, which might work with langtrace's vertex instrumentation if implemented. Use mistralai package instead of raw httpx to implement ChatMistralAI langchain-ai/langchain#29432
- since this is mostly openai compatible code, it could be possible to make a httpx based instrumentation that handles known chat completion expressions. I'm not sure if it would work.
Metadata
Metadata
Assignees
Labels
No labels