langtrace-python-sdk 2.3.15__tar.gz → 2.3.16__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/PKG-INFO +1 -1
- langtrace_python_sdk-2.3.16/src/examples/cohere_example/rerank.py +45 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/langchain_example/__init__.py +3 -1
- langtrace_python_sdk-2.3.16/src/examples/langchain_example/groq_example.py +121 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/cohere/patch.py +4 -1
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/utils/llm.py +2 -1
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/utils/misc.py +8 -0
- langtrace_python_sdk-2.3.16/src/langtrace_python_sdk/version.py +1 -0
- langtrace_python_sdk-2.3.15/src/examples/cohere_example/rerank.py +0 -32
- langtrace_python_sdk-2.3.15/src/examples/langchain_example/groq_example.py +0 -45
- langtrace_python_sdk-2.3.15/src/langtrace_python_sdk/version.py +0 -1
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/.gitignore +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/LICENSE +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/README.md +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/pyproject.toml +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/anthropic_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/anthropic_example/completion.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/autogen_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/autogen_example/main.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/azureopenai_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/azureopenai_example/completion.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/chroma_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/chroma_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/cohere_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/cohere_example/chat.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/cohere_example/chat_stream.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/cohere_example/embed.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/cohere_example/tools.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/crewai_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/crewai_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/crewai_example/instagram_post/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/crewai_example/instagram_post/agents.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/crewai_example/instagram_post/main.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/crewai_example/instagram_post/tasks.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/crewai_example/instagram_post/tools/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/crewai_example/instagram_post/tools/browser_tools.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/crewai_example/simple_agent/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/crewai_example/simple_agent/agents.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/crewai_example/simple_agent/main.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/crewai_example/simple_agent/tasks.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/crewai_example/trip_planner/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/crewai_example/trip_planner/agents.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/crewai_example/trip_planner/main.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/crewai_example/trip_planner/tasks.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/crewai_example/trip_planner/tools/calculator.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/crewai_example/trip_planner/tools/search_tools.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/dspy_example/math_problems_cot.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/dspy_example/math_problems_cot_parallel.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/dspy_example/program_of_thought_basic.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/dspy_example/quiz_gen.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/dspy_example/react.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/embedchain_example/simple.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/fastapi_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/fastapi_example/basic_route.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/gemini_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/gemini_example/function_tools.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/gemini_example/main.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/hiveagent_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/inspect_ai_example/basic_eval.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/langchain_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/langchain_example/langchain_google_example.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/langchain_example/langgraph_example.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/langchain_example/langgraph_example_tools.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/langchain_example/sagemaker.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/langchain_example/tool.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/litellm_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/llamaindex_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/llamaindex_example/agent.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/llamaindex_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/llamaindex_example/data/abramov.txt +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/mistral_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/mistral_example/complete.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/mistral_example/complete_async.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/mistral_example/embeddings.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/ollama_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/ollama_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/openai_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/openai_example/async_tool_calling_nonstreaming.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/openai_example/async_tool_calling_streaming.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/openai_example/chat_completion.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/openai_example/chat_completion_tool_choice.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/openai_example/embeddings_create.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/openai_example/function_calling.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/openai_example/images_edit.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/openai_example/images_generate.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/openai_example/resources/lounge_flamingo.png +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/openai_example/resources/mask.png +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/openai_example/send_user_feedback.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/openai_example/tool_calling.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/openai_example/tool_calling_nonstreaming.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/openai_example/tool_calling_streaming.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/otlp_example/otlp_basic.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/otlp_example/otlp_with_langtrace.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/perplexity_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/pinecone_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/pinecone_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/qdrant_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/qdrant_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/routellm_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/vertexai_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/vertexai_example/main.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/weaviate_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/weaviate_example/query_text.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/constants/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/constants/exporter/langtrace_exporter.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/constants/instrumentation/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/constants/instrumentation/anthropic.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/constants/instrumentation/chroma.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/constants/instrumentation/cohere.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/constants/instrumentation/common.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/constants/instrumentation/embedchain.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/constants/instrumentation/gemini.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/constants/instrumentation/groq.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/constants/instrumentation/mistral.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/constants/instrumentation/ollama.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/constants/instrumentation/openai.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/constants/instrumentation/pinecone.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/constants/instrumentation/qdrant.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/constants/instrumentation/vertexai.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/constants/instrumentation/weaviate.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/extensions/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/extensions/langtrace_exporter.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/extensions/langtrace_filesystem.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/anthropic/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/anthropic/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/anthropic/patch.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/anthropic/types.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/autogen/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/autogen/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/autogen/patch.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/chroma/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/chroma/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/chroma/patch.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/cohere/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/cohere/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/crewai/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/crewai/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/crewai/patch.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/dspy/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/dspy/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/dspy/patch.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/embedchain/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/embedchain/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/embedchain/patch.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/gemini/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/gemini/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/gemini/patch.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/groq/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/groq/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/groq/patch.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/langchain/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/langchain/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/langchain/patch.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/langchain_community/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/langchain_community/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/langchain_community/patch.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/langchain_core/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/langchain_core/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/langchain_core/patch.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/langgraph/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/langgraph/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/langgraph/patch.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/llamaindex/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/llamaindex/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/llamaindex/patch.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/mistral/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/mistral/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/mistral/patch.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/ollama/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/ollama/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/ollama/patch.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/openai/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/openai/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/openai/patch.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/openai/types.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/pinecone/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/pinecone/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/pinecone/patch.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/qdrant/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/qdrant/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/qdrant/patch.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/vertexai/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/vertexai/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/vertexai/patch.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/weaviate/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/weaviate/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/instrumentation/weaviate/patch.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/langtrace.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/types/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/utils/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/utils/langtrace_sampler.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/utils/prompt_registry.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/utils/sdk_version_checker.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/utils/silently_fail.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/utils/types.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/utils/with_root_span.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/run_example.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/__init__.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/anthropic/cassettes/test_anthropic.yaml +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/anthropic/cassettes/test_anthropic_streaming.yaml +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/anthropic/cassettes/test_async_anthropic_streaming.yaml +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/anthropic/conftest.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/anthropic/test_anthropic.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/chroma/conftest.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/chroma/test_chroma.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/cohere/cassettes/test_cohere_chat.yaml +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/cohere/cassettes/test_cohere_chat_streaming.yaml +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/cohere/cassettes/test_cohere_embed.yaml +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/cohere/cassettes/test_cohere_rerank.yaml +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/cohere/conftest.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/cohere/test_cohere_chat.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/cohere/test_cohere_embed.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/cohere/test_cohere_rerank.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/conftest.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/groq/cassettes/test_async_chat_completion.yaml +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/groq/cassettes/test_async_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/groq/cassettes/test_chat_completion.yaml +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/groq/cassettes/test_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/groq/conftest.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/groq/test_groq.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/langchain/cassettes/test_langchain.yaml +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/langchain/conftest.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/langchain/test_langchain.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/openai/cassettes/test_async_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/openai/cassettes/test_async_image_generation.yaml +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/openai/cassettes/test_chat_completion.yaml +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/openai/cassettes/test_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/openai/cassettes/test_image_generation.yaml +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/openai/conftest.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/openai/test_chat_completion.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/openai/test_embeddings.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/openai/test_image_generation.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/pinecone/cassettes/test_query.yaml +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/pinecone/cassettes/test_upsert.yaml +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/pinecone/conftest.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/pinecone/test_pinecone.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/qdrant/conftest.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/qdrant/test_qdrant.py +0 -0
- {langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/tests/utils.py +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import cohere
|
|
2
|
+
from dotenv import find_dotenv, load_dotenv
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
|
|
5
|
+
from langtrace_python_sdk import langtrace
|
|
6
|
+
|
|
7
|
+
# from langtrace_python_sdk.utils.with_root_span import with_langtrace_root_span
|
|
8
|
+
|
|
9
|
+
_ = load_dotenv(find_dotenv())
|
|
10
|
+
|
|
11
|
+
langtrace.init()
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
co = cohere.Client()
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# @with_langtrace_root_span("embed_create")
|
|
18
|
+
def rerank():
|
|
19
|
+
docs = [
|
|
20
|
+
{
|
|
21
|
+
"text": "Carson City is the capital city of the American state of Nevada.",
|
|
22
|
+
"date": datetime.now(),
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"text": "The Commonwealth of the Northern Mariana Islands is a group of islands in the Pacific Ocean. Its capital is Saipan.",
|
|
26
|
+
"date": datetime(2020, 5, 17),
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"text": "Washington, D.C. (also known as simply Washington or D.C., and officially as the District of Columbia) is the capital of the United States. It is a federal district.",
|
|
30
|
+
"date": datetime(1776, 7, 4),
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"text": "Capital punishment (the death penalty) has existed in the United States since before the United States was a country. As of 2017, capital punishment is legal in 30 of the 50 states.",
|
|
34
|
+
"date": datetime(2023, 9, 14),
|
|
35
|
+
},
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
response = co.rerank(
|
|
39
|
+
model="rerank-english-v2.0",
|
|
40
|
+
query="What is the capital of the United States?",
|
|
41
|
+
documents=docs,
|
|
42
|
+
top_n=3,
|
|
43
|
+
)
|
|
44
|
+
print(response)
|
|
45
|
+
return response
|
|
@@ -2,7 +2,7 @@ from examples.langchain_example.langchain_google_genai import basic_google_genai
|
|
|
2
2
|
from .basic import basic_app, rag, load_and_split
|
|
3
3
|
from langtrace_python_sdk import with_langtrace_root_span
|
|
4
4
|
|
|
5
|
-
from .groq_example import groq_basic, groq_streaming
|
|
5
|
+
from .groq_example import groq_basic, groq_tool_choice, groq_streaming
|
|
6
6
|
from .langgraph_example_tools import basic_graph_tools
|
|
7
7
|
|
|
8
8
|
|
|
@@ -20,3 +20,5 @@ class GroqRunner:
|
|
|
20
20
|
@with_langtrace_root_span("Groq")
|
|
21
21
|
def run(self):
|
|
22
22
|
groq_streaming()
|
|
23
|
+
groq_basic()
|
|
24
|
+
groq_tool_choice()
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
3
|
+
from dotenv import find_dotenv, load_dotenv
|
|
4
|
+
from groq import Groq
|
|
5
|
+
|
|
6
|
+
_ = load_dotenv(find_dotenv())
|
|
7
|
+
|
|
8
|
+
from langtrace_python_sdk import langtrace
|
|
9
|
+
|
|
10
|
+
# from langtrace_python_sdk.utils.with_root_span import with_langtrace_root_span
|
|
11
|
+
|
|
12
|
+
_ = load_dotenv(find_dotenv())
|
|
13
|
+
|
|
14
|
+
langtrace.init()
|
|
15
|
+
|
|
16
|
+
client = Groq()
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def groq_basic():
|
|
20
|
+
chat_completion = client.chat.completions.create(
|
|
21
|
+
messages=[
|
|
22
|
+
{
|
|
23
|
+
"role": "user",
|
|
24
|
+
"content": "Explain the importance of low latency LLMs",
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
stream=False,
|
|
28
|
+
model="llama3-8b-8192",
|
|
29
|
+
)
|
|
30
|
+
return chat_completion
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def groq_tool_choice():
|
|
34
|
+
|
|
35
|
+
user_prompt = "What is 25 * 4 + 10?"
|
|
36
|
+
MODEL = "llama3-groq-70b-8192-tool-use-preview"
|
|
37
|
+
|
|
38
|
+
def calculate(expression):
|
|
39
|
+
"""Evaluate a mathematical expression"""
|
|
40
|
+
try:
|
|
41
|
+
result = eval(expression)
|
|
42
|
+
return json.dumps({"result": result})
|
|
43
|
+
except:
|
|
44
|
+
return json.dumps({"error": "Invalid expression"})
|
|
45
|
+
|
|
46
|
+
messages = [
|
|
47
|
+
{
|
|
48
|
+
"role": "system",
|
|
49
|
+
"content": "You are a calculator assistant. Use the calculate function to perform mathematical operations and provide the results.",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"role": "user",
|
|
53
|
+
"content": user_prompt,
|
|
54
|
+
},
|
|
55
|
+
]
|
|
56
|
+
tools = [
|
|
57
|
+
{
|
|
58
|
+
"type": "function",
|
|
59
|
+
"function": {
|
|
60
|
+
"name": "calculate",
|
|
61
|
+
"description": "Evaluate a mathematical expression",
|
|
62
|
+
"parameters": {
|
|
63
|
+
"type": "object",
|
|
64
|
+
"properties": {
|
|
65
|
+
"expression": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"description": "The mathematical expression to evaluate",
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"required": ["expression"],
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
response = client.chat.completions.create(
|
|
76
|
+
model=MODEL,
|
|
77
|
+
messages=messages,
|
|
78
|
+
tools=tools,
|
|
79
|
+
tool_choice={"type": "function", "function": {"name": "calculate"}},
|
|
80
|
+
max_tokens=4096,
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
response_message = response.choices[0].message
|
|
84
|
+
tool_calls = response_message.tool_calls
|
|
85
|
+
if tool_calls:
|
|
86
|
+
available_functions = {
|
|
87
|
+
"calculate": calculate,
|
|
88
|
+
}
|
|
89
|
+
messages.append(response_message)
|
|
90
|
+
for tool_call in tool_calls:
|
|
91
|
+
function_name = tool_call.function.name
|
|
92
|
+
function_to_call = available_functions[function_name]
|
|
93
|
+
function_args = json.loads(tool_call.function.arguments)
|
|
94
|
+
function_response = function_to_call(
|
|
95
|
+
expression=function_args.get("expression")
|
|
96
|
+
)
|
|
97
|
+
messages.append(
|
|
98
|
+
{
|
|
99
|
+
"tool_call_id": tool_call.id,
|
|
100
|
+
"role": "tool",
|
|
101
|
+
"name": function_name,
|
|
102
|
+
"content": function_response,
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
second_response = client.chat.completions.create(model=MODEL, messages=messages)
|
|
106
|
+
return second_response.choices[0].message.content
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def groq_streaming():
|
|
110
|
+
chat_completion = client.chat.completions.create(
|
|
111
|
+
messages=[
|
|
112
|
+
{
|
|
113
|
+
"role": "user",
|
|
114
|
+
"content": "Explain the importance of low latency LLMs",
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
stream=True,
|
|
118
|
+
model="llama3-8b-8192",
|
|
119
|
+
)
|
|
120
|
+
for chunk in chat_completion:
|
|
121
|
+
print(chunk)
|
|
@@ -27,6 +27,7 @@ from langtrace_python_sdk.utils.llm import (
|
|
|
27
27
|
)
|
|
28
28
|
from langtrace.trace_attributes import Event, LLMSpanAttributes
|
|
29
29
|
from langtrace_python_sdk.utils import set_span_attribute
|
|
30
|
+
from langtrace_python_sdk.utils.misc import datetime_encoder
|
|
30
31
|
from opentelemetry.trace import SpanKind
|
|
31
32
|
from opentelemetry.trace.status import Status, StatusCode
|
|
32
33
|
|
|
@@ -50,7 +51,9 @@ def rerank(original_method, version, tracer):
|
|
|
50
51
|
SpanAttributes.LLM_REQUEST_MODEL: kwargs.get("model") or "command-r-plus",
|
|
51
52
|
SpanAttributes.LLM_URL: APIS["RERANK"]["URL"],
|
|
52
53
|
SpanAttributes.LLM_PATH: APIS["RERANK"]["ENDPOINT"],
|
|
53
|
-
SpanAttributes.LLM_REQUEST_DOCUMENTS: json.dumps(
|
|
54
|
+
SpanAttributes.LLM_REQUEST_DOCUMENTS: json.dumps(
|
|
55
|
+
kwargs.get("documents"), cls=datetime_encoder
|
|
56
|
+
),
|
|
54
57
|
SpanAttributes.LLM_COHERE_RERANK_QUERY: kwargs.get("query"),
|
|
55
58
|
**get_extra_attributes(),
|
|
56
59
|
}
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/utils/llm.py
RENAMED
|
@@ -124,6 +124,7 @@ def get_llm_request_attributes(kwargs, prompts=None, model=None, operation_name=
|
|
|
124
124
|
|
|
125
125
|
top_p = kwargs.get("p", None) or kwargs.get("top_p", None)
|
|
126
126
|
tools = kwargs.get("tools", None)
|
|
127
|
+
tool_choice = kwargs.get("tool_choice", None)
|
|
127
128
|
return {
|
|
128
129
|
SpanAttributes.LLM_OPERATION_NAME: operation_name,
|
|
129
130
|
SpanAttributes.LLM_REQUEST_MODEL: model
|
|
@@ -141,7 +142,7 @@ def get_llm_request_attributes(kwargs, prompts=None, model=None, operation_name=
|
|
|
141
142
|
SpanAttributes.LLM_FREQUENCY_PENALTY: kwargs.get("frequency_penalty"),
|
|
142
143
|
SpanAttributes.LLM_REQUEST_SEED: kwargs.get("seed"),
|
|
143
144
|
SpanAttributes.LLM_TOOLS: json.dumps(tools) if tools else None,
|
|
144
|
-
SpanAttributes.LLM_TOOL_CHOICE:
|
|
145
|
+
SpanAttributes.LLM_TOOL_CHOICE: json.dumps(tool_choice) if tool_choice else None,
|
|
145
146
|
SpanAttributes.LLM_REQUEST_LOGPROPS: kwargs.get("logprobs"),
|
|
146
147
|
SpanAttributes.LLM_REQUEST_LOGITBIAS: kwargs.get("logit_bias"),
|
|
147
148
|
SpanAttributes.LLM_REQUEST_TOP_LOGPROPS: kwargs.get("top_logprobs"),
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/utils/misc.py
RENAMED
|
@@ -60,3 +60,11 @@ def serialize_args(*args):
|
|
|
60
60
|
|
|
61
61
|
# Convert to string representation
|
|
62
62
|
return json.dumps(serializable_args)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class datetime_encoder(json.JSONEncoder):
|
|
66
|
+
def default(self, o):
|
|
67
|
+
if isinstance(o, datetime):
|
|
68
|
+
return o.isoformat()
|
|
69
|
+
|
|
70
|
+
return json.JSONEncoder.default(self, o)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.3.16"
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import cohere
|
|
2
|
-
from dotenv import find_dotenv, load_dotenv
|
|
3
|
-
|
|
4
|
-
from langtrace_python_sdk import langtrace
|
|
5
|
-
|
|
6
|
-
# from langtrace_python_sdk.utils.with_root_span import with_langtrace_root_span
|
|
7
|
-
|
|
8
|
-
_ = load_dotenv(find_dotenv())
|
|
9
|
-
|
|
10
|
-
langtrace.init()
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
co = cohere.Client()
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
# @with_langtrace_root_span("embed_create")
|
|
17
|
-
def rerank():
|
|
18
|
-
docs = [
|
|
19
|
-
"Carson City is the capital city of the American state of Nevada.",
|
|
20
|
-
"The Commonwealth of the Northern Mariana Islands is a group of islands in the Pacific Ocean. Its capital is Saipan.",
|
|
21
|
-
"Washington, D.C. (also known as simply Washington or D.C., and officially as the District of Columbia) is the capital of the United States. It is a federal district.",
|
|
22
|
-
"Capital punishment (the death penalty) has existed in the United States since beforethe United States was a country. As of 2017, capital punishment is legal in 30 of the 50 states.",
|
|
23
|
-
]
|
|
24
|
-
|
|
25
|
-
response = co.rerank(
|
|
26
|
-
model="rerank-english-v2.0",
|
|
27
|
-
query="What is the capital of the United States?",
|
|
28
|
-
documents=docs,
|
|
29
|
-
top_n=3,
|
|
30
|
-
)
|
|
31
|
-
print(response)
|
|
32
|
-
return response
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
from dotenv import find_dotenv, load_dotenv
|
|
2
|
-
from langchain_core.prompts import ChatPromptTemplate
|
|
3
|
-
from langchain_groq import ChatGroq
|
|
4
|
-
from groq import Groq
|
|
5
|
-
|
|
6
|
-
_ = load_dotenv(find_dotenv())
|
|
7
|
-
|
|
8
|
-
from langtrace_python_sdk import langtrace
|
|
9
|
-
|
|
10
|
-
# from langtrace_python_sdk.utils.with_root_span import with_langtrace_root_span
|
|
11
|
-
|
|
12
|
-
_ = load_dotenv(find_dotenv())
|
|
13
|
-
|
|
14
|
-
langtrace.init()
|
|
15
|
-
|
|
16
|
-
client = Groq()
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def groq_basic():
|
|
20
|
-
chat_completion = client.chat.completions.create(
|
|
21
|
-
messages=[
|
|
22
|
-
{
|
|
23
|
-
"role": "user",
|
|
24
|
-
"content": "Explain the importance of low latency LLMs",
|
|
25
|
-
}
|
|
26
|
-
],
|
|
27
|
-
stream=False,
|
|
28
|
-
model="llama3-8b-8192",
|
|
29
|
-
)
|
|
30
|
-
return chat_completion
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
def groq_streaming():
|
|
34
|
-
chat_completion = client.chat.completions.create(
|
|
35
|
-
messages=[
|
|
36
|
-
{
|
|
37
|
-
"role": "user",
|
|
38
|
-
"content": "Explain the importance of low latency LLMs",
|
|
39
|
-
}
|
|
40
|
-
],
|
|
41
|
-
stream=True,
|
|
42
|
-
model="llama3-8b-8192",
|
|
43
|
-
)
|
|
44
|
-
for chunk in chat_completion:
|
|
45
|
-
print(chunk)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.3.15"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/autogen_example/__init__.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/autogen_example/main.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/chroma_example/__init__.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/chroma_example/basic.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/cohere_example/__init__.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/cohere_example/chat.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/cohere_example/embed.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/cohere_example/tools.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/crewai_example/__init__.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/crewai_example/basic.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/dspy_example/quiz_gen.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/dspy_example/react.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/fastapi_example/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/gemini_example/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/gemini_example/main.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/hiveagent_example/basic.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/langchain_example/basic.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/langchain_example/tool.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/litellm_example/basic.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/llamaindex_example/agent.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/llamaindex_example/basic.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/mistral_example/__init__.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/mistral_example/complete.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/ollama_example/__init__.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/ollama_example/basic.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/openai_example/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/otlp_example/otlp_basic.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/perplexity_example/basic.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/pinecone_example/basic.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/qdrant_example/__init__.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/qdrant_example/basic.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/routellm_example/basic.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/examples/vertexai_example/main.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.3.15 → langtrace_python_sdk-2.3.16}/src/langtrace_python_sdk/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|