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

Feature: more user side log #85

Conversation

HairlessVillager
Copy link
Collaborator

这个 PR 增加了更多的日志和对应的回调函数,方便应用层展示用户侧的日志。具体来说包括以下 3 个回调函数:

  1. logAssistantReasoning:展示大模型思考过程;
  2. logToolUsing:展示正在使用的工具的名称;
  3. logToolUsingDetail:展示正在使用的工具的运行细节。

参考实现如下:

      logToolUsing: async (toolName) => {
        printLog("Using the tool: " + toolName);
      },
      logAssistantReasoning: async (reasoning) => {
        printLog("Thinking: " + reasoning);
      },
      logToolUsingDetail: async (toolName, detail) => {
        printLog(`Detail of ${toolName}: ${detail}`);
      },

This PR adds more logs and corresponding callback functions to facilitate the display of user-side logs at the application layer. Specifically, it includes the following three callback functions:

  1. logAssistantReasoning: Displays the thinking process of the large model;
  2. logToolUsing: Displays the name of the tool currently in use;
  3. logToolUsingDetail: Displays the operational details of the tool currently in use.

The reference implementation is as follows:

logToolUsing: async (toolName: string) => {
  printLog("Using the tool: " + toolName);
},
logAssistantReasoning: async (reasoning: string) => {
  printLog("Thinking: " + reasoning);
},
logToolUsingDetail: async (toolName: string, detail: string) => {
  printLog(`Detail of ${toolName}: ${detail}`);
},

@HairlessVillager
Copy link
Collaborator Author

Close as duplicate development.

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.

2 participants