-
Notifications
You must be signed in to change notification settings - Fork 604
feat(langchain): Record run_name as gen_ai.function_id on Invoke Agent Spans
#5926
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
base: webb/langchain/tool-pipeline-name
Are you sure you want to change the base?
Changes from all commits
dd79d6f
77af6f2
d02f1ca
bf72fb2
96e9d42
339eba1
45b3dae
a9d5e15
d80d395
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1398,6 +1398,175 @@ def nonstreaming_google_genai_model_response(): | |
| ) | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def streaming_chat_completions_model_responses(): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this fixture needs to be placed in the global fixtures because it's very specific to tests within a particular file. If you can foresee us re-using this across multiple test files within the AI integrations, then we should move this into a |
||
| def inner(): | ||
| yield [ | ||
| openai.types.chat.chat_completion_chunk.ChatCompletionChunk( | ||
| id="chatcmpl-turn-1", | ||
| object="chat.completion.chunk", | ||
| created=10000000, | ||
| model="gpt-3.5-turbo", | ||
| choices=[ | ||
| openai.types.chat.chat_completion_chunk.Choice( | ||
| index=0, | ||
| delta=openai.types.chat.chat_completion_chunk.ChoiceDelta( | ||
| role="assistant" | ||
| ), | ||
| finish_reason=None, | ||
| ), | ||
| ], | ||
| ), | ||
| openai.types.chat.chat_completion_chunk.ChatCompletionChunk( | ||
| id="chatcmpl-turn-1", | ||
| object="chat.completion.chunk", | ||
| created=10000000, | ||
| model="gpt-3.5-turbo", | ||
| choices=[ | ||
| openai.types.chat.chat_completion_chunk.Choice( | ||
| index=0, | ||
| delta=openai.types.chat.chat_completion_chunk.ChoiceDelta( | ||
| tool_calls=[ | ||
| openai.types.chat.chat_completion_chunk.ChoiceDeltaToolCall( | ||
| index=0, | ||
| id="call_BbeyNhCKa6kYLYzrD40NGm3b", | ||
| type="function", | ||
| function=openai.types.chat.chat_completion_chunk.ChoiceDeltaToolCallFunction( | ||
| name="get_word_length", | ||
| arguments="", | ||
| ), | ||
| ), | ||
| ], | ||
| ), | ||
| finish_reason=None, | ||
| ), | ||
| ], | ||
| ), | ||
| openai.types.chat.chat_completion_chunk.ChatCompletionChunk( | ||
| id="chatcmpl-turn-1", | ||
| object="chat.completion.chunk", | ||
| created=10000000, | ||
| model="gpt-3.5-turbo", | ||
| choices=[ | ||
| openai.types.chat.chat_completion_chunk.Choice( | ||
| index=0, | ||
| delta=openai.types.chat.chat_completion_chunk.ChoiceDelta( | ||
| tool_calls=[ | ||
| openai.types.chat.chat_completion_chunk.ChoiceDeltaToolCall( | ||
| index=0, | ||
| function=openai.types.chat.chat_completion_chunk.ChoiceDeltaToolCallFunction( | ||
| arguments='{"word": "eudca"}', | ||
| ), | ||
| ), | ||
| ], | ||
| ), | ||
| finish_reason=None, | ||
| ), | ||
| ], | ||
| ), | ||
| openai.types.chat.chat_completion_chunk.ChatCompletionChunk( | ||
| id="chatcmpl-turn-1", | ||
| object="chat.completion.chunk", | ||
| created=10000000, | ||
| model="gpt-3.5-turbo", | ||
| choices=[ | ||
| openai.types.chat.chat_completion_chunk.Choice( | ||
| index=0, | ||
| delta=openai.types.chat.chat_completion_chunk.ChoiceDelta( | ||
| content="5" | ||
| ), | ||
| finish_reason=None, | ||
| ), | ||
| ], | ||
| ), | ||
| openai.types.chat.chat_completion_chunk.ChatCompletionChunk( | ||
| id="chatcmpl-turn-1", | ||
| object="chat.completion.chunk", | ||
| created=10000000, | ||
| model="gpt-3.5-turbo", | ||
| choices=[ | ||
| openai.types.chat.chat_completion_chunk.Choice( | ||
| index=0, | ||
| delta=openai.types.chat.chat_completion_chunk.ChoiceDelta(), | ||
| finish_reason="function_call", | ||
| ), | ||
| ], | ||
| ), | ||
| openai.types.chat.chat_completion_chunk.ChatCompletionChunk( | ||
| id="chatcmpl-turn-1", | ||
| object="chat.completion.chunk", | ||
| created=10000000, | ||
| model="gpt-3.5-turbo", | ||
| choices=[], | ||
| usage=openai.types.chat.chat_completion_chunk.CompletionUsage( | ||
| prompt_tokens=142, | ||
| completion_tokens=50, | ||
| total_tokens=192, | ||
| ), | ||
| ), | ||
| ] | ||
|
|
||
| yield [ | ||
| openai.types.chat.chat_completion_chunk.ChatCompletionChunk( | ||
| id="chatcmpl-turn-2", | ||
| object="chat.completion.chunk", | ||
| created=10000000, | ||
| model="gpt-3.5-turbo", | ||
| choices=[ | ||
| openai.types.chat.chat_completion_chunk.Choice( | ||
| index=0, | ||
| delta=openai.types.chat.chat_completion_chunk.ChoiceDelta( | ||
| role="assistant" | ||
| ), | ||
| finish_reason=None, | ||
| ), | ||
| ], | ||
| ), | ||
| openai.types.chat.chat_completion_chunk.ChatCompletionChunk( | ||
| id="chatcmpl-turn-2", | ||
| object="chat.completion.chunk", | ||
| created=10000000, | ||
| model="gpt-3.5-turbo", | ||
| choices=[ | ||
| openai.types.chat.chat_completion_chunk.Choice( | ||
| index=0, | ||
| delta=openai.types.chat.chat_completion_chunk.ChoiceDelta( | ||
| content="The word eudca has 5 letters." | ||
| ), | ||
| finish_reason=None, | ||
| ), | ||
| ], | ||
| ), | ||
| openai.types.chat.chat_completion_chunk.ChatCompletionChunk( | ||
| id="chatcmpl-turn-2", | ||
| object="chat.completion.chunk", | ||
| created=10000000, | ||
| model="gpt-3.5-turbo", | ||
| choices=[ | ||
| openai.types.chat.chat_completion_chunk.Choice( | ||
| index=0, | ||
| delta=openai.types.chat.chat_completion_chunk.ChoiceDelta(), | ||
| finish_reason="stop", | ||
| ), | ||
| ], | ||
| ), | ||
| openai.types.chat.chat_completion_chunk.ChatCompletionChunk( | ||
| id="chatcmpl-turn-2", | ||
| object="chat.completion.chunk", | ||
| created=10000000, | ||
| model="gpt-3.5-turbo", | ||
| choices=[], | ||
| usage=openai.types.chat.chat_completion_chunk.CompletionUsage( | ||
| prompt_tokens=89, | ||
| completion_tokens=28, | ||
| total_tokens=117, | ||
| ), | ||
| ), | ||
| ] | ||
|
|
||
| return inner | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def responses_tool_call_model_responses(): | ||
| def inner( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.