Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Llama Index
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
run-llama
Llama Index
Commits
4636776a
Unverified
Commit
4636776a
authored
1 year ago
by
Andrei Fajardo
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
fix: bring back callback_manager to AgentRunner stream_chat (#12189)
* bring back cb stream_chat * rm storage
parent
9d8af88b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
llama-index-core/llama_index/core/agent/runner/base.py
+10
-7
10 additions, 7 deletions
llama-index-core/llama_index/core/agent/runner/base.py
with
10 additions
and
7 deletions
llama-index-core/llama_index/core/agent/runner/base.py
+
10
−
7
View file @
4636776a
...
@@ -628,6 +628,7 @@ class AgentRunner(BaseAgentRunner):
...
@@ -628,6 +628,7 @@ class AgentRunner(BaseAgentRunner):
return
chat_response
return
chat_response
@dispatcher.span
@dispatcher.span
@trace_method
(
"
chat
"
)
def
stream_chat
(
def
stream_chat
(
self
,
self
,
message
:
str
,
message
:
str
,
...
@@ -637,13 +638,15 @@ class AgentRunner(BaseAgentRunner):
...
@@ -637,13 +638,15 @@ class AgentRunner(BaseAgentRunner):
# override tool choice is provided as input.
# override tool choice is provided as input.
if
tool_choice
is
None
:
if
tool_choice
is
None
:
tool_choice
=
self
.
default_tool_choice
tool_choice
=
self
.
default_tool_choice
chat_response
=
self
.
_chat
(
with
self
.
callback_manager
.
event
(
message
=
message
,
CBEventType
.
AGENT_STEP
,
chat_history
=
chat_history
,
payload
=
{
EventPayload
.
MESSAGES
:
[
message
]},
tool_choice
=
tool_choice
,
)
as
e
:
mode
=
ChatResponseMode
.
STREAM
,
chat_response
=
self
.
_chat
(
)
message
,
chat_history
,
tool_choice
,
mode
=
ChatResponseMode
.
STREAM
assert
isinstance
(
chat_response
,
StreamingAgentChatResponse
)
)
assert
isinstance
(
chat_response
,
StreamingAgentChatResponse
)
e
.
on_end
(
payload
=
{
EventPayload
.
RESPONSE
:
chat_response
})
return
chat_response
return
chat_response
@trace_method
(
"
chat
"
)
@trace_method
(
"
chat
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment