discourse-ai/lib/modules
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
..
ai_bot FIX: implement tools framework for Anthropic (#307) 2023-11-24 06:39:56 +11:00
ai_helper PERF: Better chat thread content format for LLM (#273) 2023-10-30 19:57:46 -03:00
embeddings FIX: Make summaries more cohesive by tweaking prompt. (#310) 2023-11-23 16:33:37 -03:00
nsfw FEATURE: Handle invalid media in NSFW module (#57) 2023-05-11 15:35:39 -03:00
sentiment UX: Graph surprise next to joy in post_emotion chart (#291) 2023-11-10 14:41:50 -03:00
summarization FIX: Make summaries more cohesive by tweaking prompt. (#310) 2023-11-23 16:33:37 -03:00
toxicity DEV: applies chat namespacing (#12) 2023-03-17 15:15:38 +01:00