Skip to content
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

Orchestrator logs its own requests #14255

Merged
merged 10 commits into from
Oct 10, 2024
Merged

Orchestrator logs its own requests #14255

merged 10 commits into from
Oct 10, 2024

Conversation

JonasHelming
Copy link
Contributor

  • add data field to request
  • add option to turn off default logging
  • extracted getJsonOfText
  • add docu for getTextOfResponse

fixed #14252

What it does

Orchestrator logs its own requests separatly from the agent it delegates to.

It also adds a data field to 'request' to remember the orchestrator request id which is manually generated.

It refactors getJsonOfResponse and adds getJsonOfText

It adds documentation to getTextOfResponse to avoid other people falling into this trap: " Important: For stream responses, the stream can only be consumed once. Calling this function multiple times on the same stream response will return an empty string ('') on subsequent calls, as the stream will have already been consumed."

How to test

Do any chat requests and check the history view. For the orchestrator it should log the user requests and then the choosen agent. For the choosen agent, it should log the user request and they actual answer.

Review checklist

Reminder for reviewers

- add data field to request
- add option to turn off default logging
- extracted getJsonOfText
- add docu for getTextOfResponse

fixed #14252

Signed-off-by: Jonas Helming <jhelming@eclipsesource.com>
Copy link
Contributor

@planger planger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, works great and code looks good. Inline just a few minor nitpicks. Thank you!

packages/ai-chat/src/common/chat-model.ts Outdated Show resolved Hide resolved
packages/ai-chat/src/common/orchestrator-chat-agent.ts Outdated Show resolved Hide resolved
packages/ai-chat/src/common/orchestrator-chat-agent.ts Outdated Show resolved Hide resolved
packages/ai-chat/src/common/orchestrator-chat-agent.ts Outdated Show resolved Hide resolved
packages/ai-chat/src/common/orchestrator-chat-agent.ts Outdated Show resolved Hide resolved
packages/ai-chat/src/common/orchestrator-chat-agent.ts Outdated Show resolved Hide resolved
packages/ai-chat/src/common/orchestrator-chat-agent.ts Outdated Show resolved Hide resolved
packages/ai-chat/src/common/chat-model.ts Outdated Show resolved Hide resolved
JonasHelming and others added 8 commits October 6, 2024 20:20
Co-authored-by: Philip Langer <planger@eclipsesource.com>
Co-authored-by: Philip Langer <planger@eclipsesource.com>
Co-authored-by: Philip Langer <planger@eclipsesource.com>
Co-authored-by: Philip Langer <planger@eclipsesource.com>
Co-authored-by: Philip Langer <planger@eclipsesource.com>
Co-authored-by: Philip Langer <planger@eclipsesource.com>
Co-authored-by: Philip Langer <planger@eclipsesource.com>
Co-authored-by: Philip Langer <planger@eclipsesource.com>
@JonasHelming JonasHelming merged commit 04a8b3e into master Oct 10, 2024
11 checks passed
@github-actions github-actions bot added this to the 1.55.0 milestone Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Theia AI] The orchestrator chat agent should log its own requests (138)
2 participants