Example #1
0
        public async Task ChangeTool(string toolName)
        {
            try
            {
                ToolChangeObject toolChangeObject = new ToolChangeObject();
                toolChangeObject.message_type = "tool_change";
                toolChangeObject.session_id   = this.sessionId;
                toolChangeObject.tool_id      = toolName;

                await this.Send(toolChangeObject);
            }
            catch (Exception ex)
            {
                this.LastErrorMessage = ex.Message;
            }
        }
Example #2
0
        public static void toolChange(string contextName)
        {
            try
            {
                ToolChangeObject toolChangeObject = new ToolChangeObject();
                toolChangeObject.message_type = "tool_change";
                toolChangeObject.session_id   = sessionId;
                toolChangeObject.tool_id      = contextName;

                string s = JsonConvert.SerializeObject(toolChangeObject);
                client.Send(s);
            }
            catch (Exception ex)
            {
                string err = ex.Message;
            }
        }