forked from trpc-group/trpc-agent-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtools.py
More file actions
25 lines (21 loc) · 1.01 KB
/
Copy pathtools.py
File metadata and controls
25 lines (21 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Tencent is pleased to support the open source community by making tRPC-Agent-Python available.
#
# Copyright (C) 2026 Tencent. All rights reserved.
#
# tRPC-Agent-Python is licensed under Apache-2.0.
""" Tools for the agent. """
from trpc_agent_sdk.sessions import HistoryRecord
def make_user_history_record() -> HistoryRecord:
"""Construct user history record, simulate user's previous conversation history"""
record: dict[str, str] = {
"What's your name?":
"My name is Alice",
"what is the weather like in paris?":
"The weather in Paris is sunny with a pleasant temperature of 25 degrees Celsius. Enjoy the sunshine if you're there!",
"Do you remember my name?":
"It seems I don't have your name stored in my memory. Could you remind me what your name is? I can remember it for future conversations if you'd like!",
}
history_record = HistoryRecord()
for query, answer in record.items():
history_record.add_record(query, answer)
return history_record