discourse-ai/lib/modules/ai_bot/commands
Sam 6282b6d21f
FIX: implement tools framework for Anthropic (#307)
Previous to this changeset we used a custom system for tools/command
support for Anthropic.

We defined commands by using !command as a signal to execute it

Following Anthropic Claude 2.1, there is an official supported syntax (beta)
for tools execution.

eg:

```
+      <function_calls>
+      <invoke>
+      <tool_name>image</tool_name>
+      <parameters>
+      <prompts>
+      [
+      "an oil painting",
+      "a cute fluffy orange",
+      "3 apple's",
+      "a cat"
+      ]
+      </prompts>
+      </parameters>
+      </invoke>
+      </function_calls>
```

This implements the spec per Anthropic, it should be stable enough
to also work on other LLMs.

Keep in mind that OpenAI is not impacted here at all, as it has its
own custom system for function calls.

Additionally:

- Fixes the title system prompt so it works with latest Anthropic
- Uses new spec for "system" messages by Anthropic
- Tweak forum helper persona to guide Anthropic a tiny be better

Overall results are pretty awesome and Anthropic Claude performs
really well now on Discourse
2023-11-24 06:39:56 +11:00
..
categories_command.rb DEV: simplify command framework (#125) 2023-08-04 09:37:58 +10:00
command.rb FIX: implement tools framework for Anthropic (#307) 2023-11-24 06:39:56 +11:00
db_schema_command.rb FIX: avoid semicolons at the end of queries for SQL Helper (#268) 2023-10-27 16:21:09 +11:00
google_command.rb FIX: allow for blank fields in Google results (#255) 2023-10-19 14:44:59 +11:00
image_command.rb FIX: keep parity of shape for image command (#275) 2023-10-31 19:12:25 +11:00
read_command.rb FEATURE: add tags and categories to read context (#215) 2023-09-12 11:06:55 +10:00
search_command.rb FIX: Made bot more robust (#226) 2023-09-14 16:46:56 +10:00
search_settings_command.rb FIX: setting explorer was exceeding token budget 2023-09-01 11:48:51 +10:00
setting_context_command.rb FEATURE: add setting_context experimental command (#160) 2023-08-29 10:43:58 +10:00
summarize_command.rb DEV: simplify command framework (#125) 2023-08-04 09:37:58 +10:00
tags_command.rb DEV: simplify command framework (#125) 2023-08-04 09:37:58 +10:00
time_command.rb DEV: simplify command framework (#125) 2023-08-04 09:37:58 +10:00