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

feat: add tracing to main #367

Closed
wants to merge 4 commits into from
Closed

feat: add tracing to main #367

wants to merge 4 commits into from

Conversation

Yuan325
Copy link
Collaborator

@Yuan325 Yuan325 commented May 1, 2024

Add tracing to main. This PR add tracing for postgres.py provider and langchain orchestration.

@Yuan325 Yuan325 requested a review from a team as a code owner May 1, 2024 22:03
llm_demo/app.py Show resolved Hide resolved
llm_demo/orchestrator/helpers/tool_trace.py Show resolved Hide resolved
del session["history"]
base_history = self.get_base_history(session)
session["history"] = [base_history]
history = self.parse_messages(session["history"])
user_session.reset_memory(history)

# clear session traces
del self._user_traces[uuid]
tool_trace = ToolTrace()
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need to hang on to ToolTrace if it's used by tools?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ToolTrace is connected to each user session (to prevent it from sending the wrong tooltrace to another user. (it is similar to _user_sessions. There is another way to do this by initializing it and hanging on to it within UserAgent. What do you think about that?

llm_demo/orchestrator/helpers/tool_trace.py Show resolved Hide resolved
Comment on lines 88 to 89
if response_json.get("trace"):
tool_trace.add_message(response_json.get("trace"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if response_json.get("trace"):
tool_trace.add_message(response_json.get("trace"))
trace = response_json.get("trace")
if trace:
tool_trace.add_message(trace)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to validate trace is in the right format somewhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

"trace" are build in retrieval service/app/routes.py (src code is in: retrieval_service/helpers/helpers.py) before sending it back to the UI.

@Yuan325 Yuan325 force-pushed the add-tracing branch 3 times, most recently from 55a31cb to 96c5336 Compare May 20, 2024 17:41
@Yuan325 Yuan325 requested a review from kurtisvg May 20, 2024 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants