From f8672067464fd578fcaaef488ffdaf194fbbea6e Mon Sep 17 00:00:00 2001 From: valentimarco Date: Sun, 23 Jun 2024 12:55:47 +0200 Subject: [PATCH] refactor: rename folder and moved auto-gen api docs --- mkdocs.yml | 30 ++++---- .../diagrams/chatting-with-the-cat.drawio | 24 +++--- .../cheshire_cat/agent.md | 0 .../cheshire_cat/core.md | 0 .../cheshire_cat/mad_hatter.md | 0 .../cheshire_cat/memory_chain.md | 0 .../cheshire_cat/rabbit_hole.md | 0 .../cheshire_cat/tool_chain.md | 0 .../{conceptual => cat-components}/llm.md | 0 .../memory/declarative_memory.md | 0 .../memory/episodic_memory.md | 0 .../memory/long_term_memory.md | 0 .../memory/procedural_memory.md | 0 .../memory/vector_memory.md | 2 +- .../memory/working_memory.md | 0 .../{conceptual => cat-components}/plugins.md | 0 .../prompts/instructions.md | 0 .../prompts/main_prompt.md | 0 mkdocs/index.md | 4 +- mkdocs/plugins/forms.md | 2 +- mkdocs/plugins/hooks.md | 76 ++++++++++--------- mkdocs/plugins/logging.md | 9 ++- mkdocs/plugins/tools.md | 2 +- mkdocs/production/advanced/user_system.md | 4 +- .../production/clientlib/clientlib-python.md | 6 +- .../technical/basics/admin/admin-interface.md | 6 +- mkdocs/technical/basics/admin/memory.md | 9 +-- mkdocs/technical/basics/admin/settings.md | 4 +- 28 files changed, 92 insertions(+), 86 deletions(-) rename mkdocs/framework/{conceptual => cat-components}/cheshire_cat/agent.md (100%) rename mkdocs/framework/{conceptual => cat-components}/cheshire_cat/core.md (100%) rename mkdocs/framework/{conceptual => cat-components}/cheshire_cat/mad_hatter.md (100%) rename mkdocs/framework/{conceptual => cat-components}/cheshire_cat/memory_chain.md (100%) rename mkdocs/framework/{conceptual => cat-components}/cheshire_cat/rabbit_hole.md (100%) rename mkdocs/framework/{conceptual => cat-components}/cheshire_cat/tool_chain.md (100%) rename mkdocs/framework/{conceptual => cat-components}/llm.md (100%) rename mkdocs/framework/{conceptual => cat-components}/memory/declarative_memory.md (100%) rename mkdocs/framework/{conceptual => cat-components}/memory/episodic_memory.md (100%) rename mkdocs/framework/{conceptual => cat-components}/memory/long_term_memory.md (100%) rename mkdocs/framework/{conceptual => cat-components}/memory/procedural_memory.md (100%) rename mkdocs/framework/{conceptual => cat-components}/memory/vector_memory.md (93%) rename mkdocs/framework/{conceptual => cat-components}/memory/working_memory.md (100%) rename mkdocs/framework/{conceptual => cat-components}/plugins.md (100%) rename mkdocs/framework/{conceptual => cat-components}/prompts/instructions.md (100%) rename mkdocs/framework/{conceptual => cat-components}/prompts/main_prompt.md (100%) diff --git a/mkdocs.yml b/mkdocs.yml index 797d3996c..227a0d79f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -20,7 +20,7 @@ plugins: - mkdocstrings: handlers: python: - paths: [mkdocs/technical/API_Documentation] + paths: [mkdocs/API_Documentation] options: docstring_style: numpy @@ -65,24 +65,24 @@ nav: - Encoder: framework/llm-concepts/embedder.md - Vector Memory: framework/llm-concepts/vector-memory.md - Cat Components: - - The Core: framework/conceptual/cheshire_cat/core.md + - The Core: framework/cat-components/cheshire_cat/core.md - The Agent: - - Introduction: framework/conceptual/cheshire_cat/agent.md - - Tool Chain: framework/conceptual/cheshire_cat/tool_chain.md - - Memory Chain: framework/conceptual/cheshire_cat/memory_chain.md + - Introduction: framework/cat-components/cheshire_cat/agent.md + - Tool Chain: framework/cat-components/cheshire_cat/tool_chain.md + - Memory Chain: framework/cat-components/cheshire_cat/memory_chain.md - The Prompts: - - Main Prompt: framework/conceptual/prompts/main_prompt.md - - Instruction Prompt: framework/conceptual/prompts/instructions.md + - Main Prompt: framework/cat-components/prompts/main_prompt.md + - Instruction Prompt: framework/cat-components/prompts/instructions.md - The Vector Memory: - - Vector Memory Collections: framework/conceptual/memory/vector_memory.md + - Vector Memory Collections: framework/cat-components/memory/vector_memory.md - The Long Term Memory: - - Introduction: framework/conceptual/memory/long_term_memory.md - - Episodic Memory: framework/conceptual/memory/episodic_memory.md - - Declarative Memory: framework/conceptual/memory/declarative_memory.md - - Procedural Memory: framework/conceptual/memory/procedural_memory.md - - The Working Memory: framework/conceptual/memory/working_memory.md - - The Rabbit Hole: framework/conceptual/cheshire_cat/rabbit_hole.md - - The Mad Hatter: framework/conceptual/cheshire_cat/mad_hatter.md + - Introduction: framework/cat-components/memory/long_term_memory.md + - Episodic Memory: framework/cat-components/memory/episodic_memory.md + - Declarative Memory: framework/cat-components/memory/declarative_memory.md + - Procedural Memory: framework/cat-components/memory/procedural_memory.md + - The Working Memory: framework/cat-components/memory/working_memory.md + - The Rabbit Hole: framework/cat-components/cheshire_cat/rabbit_hole.md + - The Mad Hatter: framework/cat-components/cheshire_cat/mad_hatter.md - Technical Diagrams: - The Cat Bootstrap: framework/flows/cat-bootstrap.md - Chatting with the Cat: framework/flows/chatting-with-the-cat.md diff --git a/mkdocs/assets/diagrams/chatting-with-the-cat.drawio b/mkdocs/assets/diagrams/chatting-with-the-cat.drawio index 181e85cc7..5fecff027 100644 --- a/mkdocs/assets/diagrams/chatting-with-the-cat.drawio +++ b/mkdocs/assets/diagrams/chatting-with-the-cat.drawio @@ -697,7 +697,7 @@ - + @@ -900,7 +900,7 @@ - + @@ -917,7 +917,7 @@ - + @@ -928,7 +928,7 @@ - + @@ -960,17 +960,17 @@ - + - + - + @@ -1671,7 +1671,7 @@ - + @@ -1679,7 +1679,7 @@ - + @@ -1697,12 +1697,12 @@ - + - + @@ -1880,7 +1880,7 @@ - + diff --git a/mkdocs/framework/conceptual/cheshire_cat/agent.md b/mkdocs/framework/cat-components/cheshire_cat/agent.md similarity index 100% rename from mkdocs/framework/conceptual/cheshire_cat/agent.md rename to mkdocs/framework/cat-components/cheshire_cat/agent.md diff --git a/mkdocs/framework/conceptual/cheshire_cat/core.md b/mkdocs/framework/cat-components/cheshire_cat/core.md similarity index 100% rename from mkdocs/framework/conceptual/cheshire_cat/core.md rename to mkdocs/framework/cat-components/cheshire_cat/core.md diff --git a/mkdocs/framework/conceptual/cheshire_cat/mad_hatter.md b/mkdocs/framework/cat-components/cheshire_cat/mad_hatter.md similarity index 100% rename from mkdocs/framework/conceptual/cheshire_cat/mad_hatter.md rename to mkdocs/framework/cat-components/cheshire_cat/mad_hatter.md diff --git a/mkdocs/framework/conceptual/cheshire_cat/memory_chain.md b/mkdocs/framework/cat-components/cheshire_cat/memory_chain.md similarity index 100% rename from mkdocs/framework/conceptual/cheshire_cat/memory_chain.md rename to mkdocs/framework/cat-components/cheshire_cat/memory_chain.md diff --git a/mkdocs/framework/conceptual/cheshire_cat/rabbit_hole.md b/mkdocs/framework/cat-components/cheshire_cat/rabbit_hole.md similarity index 100% rename from mkdocs/framework/conceptual/cheshire_cat/rabbit_hole.md rename to mkdocs/framework/cat-components/cheshire_cat/rabbit_hole.md diff --git a/mkdocs/framework/conceptual/cheshire_cat/tool_chain.md b/mkdocs/framework/cat-components/cheshire_cat/tool_chain.md similarity index 100% rename from mkdocs/framework/conceptual/cheshire_cat/tool_chain.md rename to mkdocs/framework/cat-components/cheshire_cat/tool_chain.md diff --git a/mkdocs/framework/conceptual/llm.md b/mkdocs/framework/cat-components/llm.md similarity index 100% rename from mkdocs/framework/conceptual/llm.md rename to mkdocs/framework/cat-components/llm.md diff --git a/mkdocs/framework/conceptual/memory/declarative_memory.md b/mkdocs/framework/cat-components/memory/declarative_memory.md similarity index 100% rename from mkdocs/framework/conceptual/memory/declarative_memory.md rename to mkdocs/framework/cat-components/memory/declarative_memory.md diff --git a/mkdocs/framework/conceptual/memory/episodic_memory.md b/mkdocs/framework/cat-components/memory/episodic_memory.md similarity index 100% rename from mkdocs/framework/conceptual/memory/episodic_memory.md rename to mkdocs/framework/cat-components/memory/episodic_memory.md diff --git a/mkdocs/framework/conceptual/memory/long_term_memory.md b/mkdocs/framework/cat-components/memory/long_term_memory.md similarity index 100% rename from mkdocs/framework/conceptual/memory/long_term_memory.md rename to mkdocs/framework/cat-components/memory/long_term_memory.md diff --git a/mkdocs/framework/conceptual/memory/procedural_memory.md b/mkdocs/framework/cat-components/memory/procedural_memory.md similarity index 100% rename from mkdocs/framework/conceptual/memory/procedural_memory.md rename to mkdocs/framework/cat-components/memory/procedural_memory.md diff --git a/mkdocs/framework/conceptual/memory/vector_memory.md b/mkdocs/framework/cat-components/memory/vector_memory.md similarity index 93% rename from mkdocs/framework/conceptual/memory/vector_memory.md rename to mkdocs/framework/cat-components/memory/vector_memory.md index adbe60369..72f0d8ef1 100644 --- a/mkdocs/framework/conceptual/memory/vector_memory.md +++ b/mkdocs/framework/cat-components/memory/vector_memory.md @@ -15,7 +15,7 @@ By default, Vector Memory Collections are created when the Cat is installed or a ## Vector Memory Collections flow :material-information-outline:{ title="click on the nodes with hooks to see their documentation" } !!! note "Developer documentation" - [Vector Memory Collections hooks](../../technical/API_Documentation/mad_hatter/core_plugin/hooks/memory.md) + [Vector Memory Collections hooks](../../API_Documentation/mad_hatter/core_plugin/hooks/memory.md) ```mermaid flowchart LR diff --git a/mkdocs/framework/conceptual/memory/working_memory.md b/mkdocs/framework/cat-components/memory/working_memory.md similarity index 100% rename from mkdocs/framework/conceptual/memory/working_memory.md rename to mkdocs/framework/cat-components/memory/working_memory.md diff --git a/mkdocs/framework/conceptual/plugins.md b/mkdocs/framework/cat-components/plugins.md similarity index 100% rename from mkdocs/framework/conceptual/plugins.md rename to mkdocs/framework/cat-components/plugins.md diff --git a/mkdocs/framework/conceptual/prompts/instructions.md b/mkdocs/framework/cat-components/prompts/instructions.md similarity index 100% rename from mkdocs/framework/conceptual/prompts/instructions.md rename to mkdocs/framework/cat-components/prompts/instructions.md diff --git a/mkdocs/framework/conceptual/prompts/main_prompt.md b/mkdocs/framework/cat-components/prompts/main_prompt.md similarity index 100% rename from mkdocs/framework/conceptual/prompts/main_prompt.md rename to mkdocs/framework/cat-components/prompts/main_prompt.md diff --git a/mkdocs/index.md b/mkdocs/index.md index 697495d41..56673bf21 100644 --- a/mkdocs/index.md +++ b/mkdocs/index.md @@ -46,7 +46,7 @@ ## Cheshire Cat Features The Cheshire Cat is an open-source, hackable and production-ready framework that allows developing intelligent personal -AI assistant agents on top of [Large Language Models](framework/conceptual/llm.md) (LLM). +AI assistant agents on top of [Large Language Models](framework/cat-components/llm.md) (LLM).
@@ -88,7 +88,7 @@ AI assistant agents on top of [Large Language Models](framework/conceptual/llm.m Make use of a persistent memory across restarts! - [:octicons-arrow-right-24: Cat's Long Term Memory](framework/conceptual/memory/long_term_memory.md) + [:octicons-arrow-right-24: Cat's Long Term Memory](framework/cat-components/memory/long_term_memory.md) - 🐋 __100% dockerized__ diff --git a/mkdocs/plugins/forms.md b/mkdocs/plugins/forms.md index f787bd98a..32f565c17 100644 --- a/mkdocs/plugins/forms.md +++ b/mkdocs/plugins/forms.md @@ -66,7 +66,7 @@ class PizzaForm(CatForm): #(3) 1. Pydantic class representing the information you need to retrieve. 2. Every class decorated with `@forms` is a Form. 3. Every Form must inherit from `CatForm`. -4. Description of the Form. +4. Description of the Form. 5. Pydantic class name. 6. Each Form must include a list of *start examples* to guide the LLM in identifying and initiating the form. This is close to the tool's docstring principle. 7. Each Form must include a list of *stop examples* to help the LLM in determining when to stop the form during the conversation. diff --git a/mkdocs/plugins/hooks.md b/mkdocs/plugins/hooks.md index b3d55348b..4c9bb0c69 100644 --- a/mkdocs/plugins/hooks.md +++ b/mkdocs/plugins/hooks.md @@ -3,6 +3,7 @@ Hooks are Python functions that are called directly from the Cat at runtime, they allow you to change how the Cat internally works without directly modifying the Cat itself. ## How the Hooks work + To create a hook, you first need to create a [plugin](plugins.md) that contains it. Once the plugin is created, you can insert hooks inside the plugin, a single plugin can contain multiple hooks. A hook is simply a Python function that uses the `@hook` decorator, the function's name determines when it will be called. @@ -36,13 +37,15 @@ def before_cat_sends_message(final_output, cat): *Some hooks receive more than one argument, the value determined by the Cat is always the first argument, all the other parameters are solely context parameters, which hooks cannot modify, the last parameter is always the Cat instance.* ## Multiple Implementations -Several plugins can implement the same hook. The argument `priority` of the `@hook` decorator allows you to set the priority of the hook, the default value is 1. + +Several plugins can implement the same hook. The argument `priority` of the `@hook` decorator allows you to set the priority of the hook, the default value is 1. The Cat calls the implementations in order of priority. Hooks with a higher priority number will be called first. The following hooks will receive the value returned by the previous hook. In this way, hooks can be chained together to create complex behaviors. If two plugins have the same priority, the order in which they are called is not guaranteed. ## Available Hooks + You can view the list of available hooks by exploring the Cat source code under the folder `core/cat/mad_hatter/core_plugin/hooks`. All the hooks you find in there define default Cat's behavior and are ready to be overridden by your plugins. @@ -89,7 +92,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/hooks/flow/#cat.mad_hatter.core_plugin.hooks.flow.before_cat_bootstrap) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/hooks/flow/#cat.mad_hatter.core_plugin.hooks.flow.before_cat_bootstrap) - [Debugger plugin](https://github.com/sambarza/cc-vscode-debugpy) 2. **Input arguments** @@ -107,7 +110,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/hooks/flow/#cat.mad_hatter.core_plugin.hooks.flow.after_cat_bootstrap) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/hooks/flow/#cat.mad_hatter.core_plugin.hooks.flow.after_cat_bootstrap) 3. **Input arguments** `user_message_json`: a dictionary with the JSON message sent via WebSocket. E.g.: @@ -132,7 +135,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/hooks/flow/#cat.mad_hatter.core_plugin.hooks.flow.before_cat_reads_message) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/hooks/flow/#cat.mad_hatter.core_plugin.hooks.flow.before_cat_reads_message) 4. **Input arguments** `user_message`: a string with the user's message that will be used to query the vector memories. E.g.: @@ -157,7 +160,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resourcer" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/hooks/flow/#cat.mad_hatter.core_plugin.hooks.flow.cat_recall_query) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/hooks/flow/#cat.mad_hatter.core_plugin.hooks.flow.cat_recall_query) - [HyDE plugin](https://github.com/Furrmidable-Crew/ccat_hyde) 5. **Input arguments** @@ -175,7 +178,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/hooks/flow/#cat.mad_hatter.core_plugin.hooks.flow.before_cat_recalls_memories) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/hooks/flow/#cat.mad_hatter.core_plugin.hooks.flow.before_cat_recalls_memories) 6. **Input arguments** `episodic_recall_config`: dictionary with the recall configuration for the episodic memory. Default is: @@ -204,7 +207,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/hooks/flow/#cat.mad_hatter.core_plugin.hooks.flow.before_cat_recalls_episodic_memories) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/hooks/flow/#cat.mad_hatter.core_plugin.hooks.flow.before_cat_recalls_episodic_memories) - [C.A.T. plugin](https://github.com/Furrmidable-Crew/cat_advanced_tools) 7. **Input arguments** @@ -235,7 +238,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/hooks/flow/#cat.mad_hatter.core_plugin.hooks.flow.before_cat_recalls_declarative_memories) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/hooks/flow/#cat.mad_hatter.core_plugin.hooks.flow.before_cat_recalls_declarative_memories) - [RabbitHole segmentation plugin](https://github.com/team-sviluppo/cc_rabbithole_segmentation) - [C.A.T. plugin](https://github.com/Furrmidable-Crew/cat_advanced_tools) @@ -266,7 +269,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/hooks/flow/#cat.mad_hatter.core_plugin.hooks.flow.before_cat_recalls_procedural_memories) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/hooks/flow/#cat.mad_hatter.core_plugin.hooks.flow.before_cat_recalls_procedural_memories) - [C.A.T. plugin](https://github.com/Furrmidable-Crew/cat_advanced_tools) 9. **Input arguments** @@ -284,7 +287,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/hooks/flow/#cat.mad_hatter.core_plugin.hooks.flow.after_cat_recalls_memories) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/hooks/flow/#cat.mad_hatter.core_plugin.hooks.flow.after_cat_recalls_memories) 10. **Input arguments** `doc`: Langchain Document to be inserted in memory. E.g.: @@ -312,7 +315,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/hooks/flow/#cat.mad_hatter.core_plugin.hooks.flow.before_cat_stores_episodic_memory) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/hooks/flow/#cat.mad_hatter.core_plugin.hooks.flow.before_cat_stores_episodic_memory) 11. **Input arguments** `message`: the dictionary containing the Cat's answer that will be sent via WebSocket. E.g.: @@ -350,10 +353,10 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/hooks/flow/#cat.mad_hatter.core_plugin.hooks.flow.before_cat_sends_message) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/hooks/flow/#cat.mad_hatter.core_plugin.hooks.flow.before_cat_sends_message) === "🤖 Agent" - +
| Name | Description | @@ -395,7 +398,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/hooks/agent/#cat.mad_hatter.core_plugin.hooks.agent.before_agent_starts) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/hooks/agent/#cat.mad_hatter.core_plugin.hooks.agent.before_agent_starts) 2. **Input arguments** `fast_reply`: empty dictionary. @@ -424,7 +427,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/hooks/agent/#cat.mad_hatter.core_plugin.hooks.agent.agent_fast_reply) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/hooks/agent/#cat.mad_hatter.core_plugin.hooks.agent.agent_fast_reply) - [Stay on topic plugin](https://github.com/Furrmidable-Crew/stay_on_topic) 3. **Input arguments** @@ -453,7 +456,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/hooks/prompt/#cat.mad_hatter.core_plugin.hooks.prompt.agent_prompt_prefix) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/hooks/prompt/#cat.mad_hatter.core_plugin.hooks.prompt.agent_prompt_prefix) 4. **Input arguments** `prompt_suffix`: string with the ending part of the prompt containing the memories and the chat history. @@ -508,7 +511,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/hooks/prompt/#cat.mad_hatter.core_plugin.hooks.prompt.agent_prompt_suffix) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/hooks/prompt/#cat.mad_hatter.core_plugin.hooks.prompt.agent_prompt_suffix) - [C.A.T. plugin](https://github.com/Furrmidable-Crew/cat_advanced_tools) 5. **Input arguments** @@ -534,7 +537,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/hooks/agent/#cat.mad_hatter.core_plugin.hooks.agent.agent_allowed_tools) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/hooks/agent/#cat.mad_hatter.core_plugin.hooks.agent.agent_allowed_tools) 6. **Input arguments** `instructions`: string with the reasoning template. Default is: @@ -581,10 +584,10 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/hooks/prompt/#cat.mad_hatter.core_plugin.hooks.prompt.agent_prompt_instructions) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/hooks/prompt/#cat.mad_hatter.core_plugin.hooks.prompt.agent_prompt_instructions) === "🐰 Rabbit Hole" - +
| Name | Description | @@ -628,7 +631,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/hooks/rabbithole/#cat.mad_hatter.core_plugin.hooks.rabbithole.rabbithole_instantiates_parsers) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/hooks/rabbithole/#cat.mad_hatter.core_plugin.hooks.rabbithole.rabbithole_instantiates_parsers) - [IngestAnything plugin](https://github.com/Furrmidable-Crew/IngestAnything) 2. **Input arguments** @@ -657,7 +660,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/hooks/rabbithole/#cat.mad_hatter.core_plugin.hooks.rabbithole.before_rabbithole_insert_memory) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/hooks/rabbithole/#cat.mad_hatter.core_plugin.hooks.rabbithole.before_rabbithole_insert_memory) - [RabbitHole segmentation plugin](https://github.com/team-sviluppo/cc_rabbithole_segmentation) - [Summarization plugin](https://github.com/Furrmidable-Crew/ccat_summarization) @@ -682,7 +685,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/hooks/rabbithole/#cat.mad_hatter.core_plugin.hooks.rabbithole.before_rabbithole_splits_text) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/hooks/rabbithole/#cat.mad_hatter.core_plugin.hooks.rabbithole.before_rabbithole_splits_text) 4. **Input arguments** `chunks`: list of Langchain documents with text chunks. @@ -704,7 +707,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/hooks/rabbithole/#cat.mad_hatter.core_plugin.hooks.rabbithole.after_rabbithole_splitted_text) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/hooks/rabbithole/#cat.mad_hatter.core_plugin.hooks.rabbithole.after_rabbithole_splitted_text) 5. **Input arguments** `docs`: list of chunked Langchain documents before being inserted in memory. @@ -735,7 +738,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/hooks/rabbithole/#cat.mad_hatter.core_plugin.hooks.rabbithole.before_rabbithole_stores_documents) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/hooks/rabbithole/#cat.mad_hatter.core_plugin.hooks.rabbithole.before_rabbithole_stores_documents) - [Summarization plugin](https://github.com/Furrmidable-Crew/ccat_summarization) 6. **Input arguments** @@ -755,7 +758,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/hooks/rabbithole/#cat.mad_hatter.core_plugin.hooks.rabbithole.after_rabbithole_stored_documents) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/hooks/rabbithole/#cat.mad_hatter.core_plugin.hooks.rabbithole.after_rabbithole_stored_documents) 7. **Input arguments** @@ -782,7 +785,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/hooks/rabbithole/#cat.mad_hatter.core_plugin.hooks.rabbithole.rabbithole_instantiates_parsers) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/hooks/rabbithole/#cat.mad_hatter.core_plugin.hooks.rabbithole.rabbithole_instantiates_parsers) - [IngestAnything Plugin](https://github.com/Furrmidable-Crew/IngestAnything) 8. **Input arguments** @@ -803,10 +806,10 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/hooks/rabbithole/#cat.mad_hatter.core_plugin.hooks.rabbithole.rabbithole_instantiates_splitter) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/hooks/rabbithole/#cat.mad_hatter.core_plugin.hooks.rabbithole.rabbithole_instantiates_splitter) === "🔌 Plugin" - +
| Name | Description | @@ -845,7 +848,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/settings/#cat.mad_hatter.core_plugin.settings.activated) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/settings/#cat.mad_hatter.core_plugin.settings.activated) - [Plugin object](https://github.com/cheshire-cat-ai/core/blob/main/core/cat/mad_hatter/plugin.py#L25) 2. **Input arguments** @@ -877,7 +880,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/settings/#cat.mad_hatter.core_plugin.settings.deactivated) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/settings/#cat.mad_hatter.core_plugin.settings.deactivated) - [Plugin object](https://github.com/cheshire-cat-ai/core/blob/main/core/cat/mad_hatter/plugin.py#L25) 3. **Input arguments** @@ -925,7 +928,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - [Example Plugin: C.A.T. Cat Advanced Tools](https://github.com/Furrmidable-Crew/cat_advanced_tools) - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/settings/#cat.mad_hatter.core_plugin.settings.settings_schema) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/settings/#cat.mad_hatter.core_plugin.settings.settings_schema) - [Plugin object](https://github.com/cheshire-cat-ai/core/blob/main/core/cat/mad_hatter/plugin.py#L25) 4. **Input arguments** @@ -975,7 +978,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/settings/#cat.mad_hatter.core_plugin.settings.settings_model) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/settings/#cat.mad_hatter.core_plugin.settings.settings_model) - [Plugin object](https://github.com/cheshire-cat-ai/core/blob/main/core/cat/mad_hatter/plugin.py#L25) 5. **Input arguments** @@ -1007,7 +1010,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/settings/#cat.mad_hatter.core_plugin.settings.load_settings) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/settings/#cat.mad_hatter.core_plugin.settings.load_settings) - [Plugin object](https://github.com/cheshire-cat-ai/core/blob/main/core/cat/mad_hatter/plugin.py#L25) 6. **Input arguments** @@ -1043,7 +1046,7 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d ??? note "Other resources" - - [Python reference](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/mad_hatter/core_plugin/settings/#cat.mad_hatter.core_plugin.settings.save_settings) + - [Python reference](https://cheshire-cat-ai.github.io/docs/API_Documentation/mad_hatter/core_plugin/settings/#cat.mad_hatter.core_plugin.settings.save_settings) - [Plugin object](https://github.com/cheshire-cat-ai/core/blob/main/core/cat/mad_hatter/plugin.py#L25) === "🏭 Factory" @@ -1136,5 +1139,4 @@ Not all the hooks have been documented yet. ( [help needed! 😸](https://d - [Python reference]() - [Plugin object](https://github.com/cheshire-cat-ai/core/blob/main/core/cat/mad_hatter/core_plugin/hooks/language.py#L23) - -> **_NOTE:_** Any function in a plugin decorated by `@plugin` and named properly (among the list of available overrides, **Plugin** tab in the table above) is used to override plugin behaviour. These are not hooks because they are not piped, they are *specific* for every plugin. +> ***NOTE:*** Any function in a plugin decorated by `@plugin` and named properly (among the list of available overrides, **Plugin** tab in the table above) is used to override plugin behaviour. These are not hooks because they are not piped, they are *specific* for every plugin. diff --git a/mkdocs/plugins/logging.md b/mkdocs/plugins/logging.md index fddb5d4da..f4fee1d9e 100644 --- a/mkdocs/plugins/logging.md +++ b/mkdocs/plugins/logging.md @@ -17,17 +17,22 @@ Note that the logger is created by default with level `WARNING` (`LOG_LEVEL=${LO Logging messages which are less severe than *level* will be ignored; logging messages which have severity *level* or higher will be emitted to the console. ## How to + The logging system can be imported like this + ``` from cat.log import log ``` + and then used as easy as: + ``` log.error("A simple text here") log.info(f"Value of user message is {user_message_json["text"]}") log.critical(variable_value) ``` -Take a look [here](https://cheshire-cat-ai.github.io/docs/technical/API_Documentation/log/) if you want to better understand how the log system is implemented. + +Take a look [here](https://cheshire-cat-ai.github.io/docs///API_Documentation/log/) if you want to better understand how the log system is implemented. ## Examples @@ -91,4 +96,4 @@ Follows an example of the console log for each log level. - what the console logs: - cheshire_cat_core | [2024-01-20 18:11:24.992] CRITICAL cat.plugins.cat-formatter.cat_formatter..before_cat_reads_message::26 => 'user message: The answer to all questions is 42.' \ No newline at end of file + cheshire_cat_core | [2024-01-20 18:11:24.992] CRITICAL cat.plugins.cat-formatter.cat_formatter..before_cat_reads_message::26 => 'user message: The answer to all questions is 42.' diff --git a/mkdocs/plugins/tools.md b/mkdocs/plugins/tools.md index eb8dfa95a..180d195f4 100644 --- a/mkdocs/plugins/tools.md +++ b/mkdocs/plugins/tools.md @@ -246,7 +246,7 @@ def convert_currency(tool_input, cat): # (1) **Cat's answer**: > 7.5 euros is equal to 6.45 British Pounds. -As you may see, the [Agent](../framework/conceptual/cheshire_cat/agent.md) correctly understands the desired output from the message +As you may see, the [Agent](../framework/cat-components/cheshire_cat/agent.md) correctly understands the desired output from the message and passes it to the tool function as explained in the docstring. Then, it is up to us parse the two inputs correctly for our tool. ### External library & the cat parameter diff --git a/mkdocs/production/advanced/user_system.md b/mkdocs/production/advanced/user_system.md index cae211435..dec51a500 100644 --- a/mkdocs/production/advanced/user_system.md +++ b/mkdocs/production/advanced/user_system.md @@ -1,8 +1,8 @@ # 👥 User System The Cat provides a basic user management system that allows having separated memories for each user. -The user system affects only the [working memory](../../framework/conceptual/memory/working_memory.md) and -the [episodic memory](../../framework/conceptual/memory/long_term_memory.md). +The user system affects only the [working memory](../../framework/cat-components/memory/working_memory.md) and +the [episodic memory](../../framework/cat-components/memory/long_term_memory.md). The other memories are shared among users. More in details, the websocket client indicates the current `user_id` by calling the `ws://localhost:1865/ws/{user_id}` endpoint. diff --git a/mkdocs/production/clientlib/clientlib-python.md b/mkdocs/production/clientlib/clientlib-python.md index 21d4f0086..05f25dd00 100644 --- a/mkdocs/production/clientlib/clientlib-python.md +++ b/mkdocs/production/clientlib/clientlib-python.md @@ -13,7 +13,7 @@ To add the client to your project, install it with pip: pip install cheshire_cat_api ``` -Then, you can import the base class like this: +Then, you can import the base class like this: ```python import cheshire_cat_api as ccat @@ -134,7 +134,7 @@ from cheshire_cat_api.models.body_upload_url import BodyUploadUrl # a URL requires structuring the body like this body_upload_url = BodyUploadUrl( - url="https://cheshire-cat-ai.github.io/docs/conceptual/cheshire_cat/rabbit_hole/" + url="https://cheshire-cat-ai.github.io/docs/cat-components/cheshire_cat/rabbit_hole/" ) # then you can make the request as follows @@ -183,4 +183,4 @@ response = cat_client.memory.wipe_collections() | `rabbit_hole` | `POST` | | | | | `POST` | | | | | `POST` | | | -| | `GET` | | | \ No newline at end of file +| | `GET` | | | diff --git a/mkdocs/technical/basics/admin/admin-interface.md b/mkdocs/technical/basics/admin/admin-interface.md index 3ecc5e083..5b40d9f3b 100644 --- a/mkdocs/technical/basics/admin/admin-interface.md +++ b/mkdocs/technical/basics/admin/admin-interface.md @@ -15,7 +15,7 @@ The frontend interface of The Cheshire Cat can be accessed via `localhost:1865/admin`. This interface provides you with an easy-to-use chat that acts as a playground and can be used to interact with your application. -The Cat core uses a static build of the admin, +The Cat core uses a static build of the admin, source code can be found [here](https://github.com/cheshire-cat-ai/admin-vue). The home page of the Admin interface is where it possible to chat with the Cat. @@ -55,8 +55,8 @@ at the bottom left the source of the memory and on the bottom right the upload t ![Flash button](../../../assets/img/admin_screenshots/modal_home.png){ width="150" } -1. **Prompt settings**: allows customizing the main prompt [prefix](../../../conceptual/prompts/main_prompt.md#prefix). +1. **Prompt settings**: allows customizing the main prompt [prefix](../../../cat-components/prompts/main_prompt.md#prefix). 2. **Upload memories**: allows uploading memories in the format of JSON files. 3. **Upload url**: allows uploading a web page in memory providing an url. 4. **Upload file**: allows uploading a file in memory. Supported formats are `.txt`, `.pdf` and `.md`. -5. **Clear conversation**: clear the current conversation and delete the conversation history in the [working memory](../../../conceptual/memory/working_memory.md). \ No newline at end of file +5. **Clear conversation**: clear the current conversation and delete the conversation history in the [working memory](../../../cat-components/memory/working_memory.md). diff --git a/mkdocs/technical/basics/admin/memory.md b/mkdocs/technical/basics/admin/memory.md index 6146c66fc..ef254adc3 100644 --- a/mkdocs/technical/basics/admin/memory.md +++ b/mkdocs/technical/basics/admin/memory.md @@ -1,6 +1,6 @@ # Memory -The Memory page allows interacting with the Cat's [long term memory](../../../conceptual/memory/long_term_memory.md). +The Memory page allows interacting with the Cat's [long term memory](../../../cat-components/memory/long_term_memory.md). Specifically, it is possible to query the vector collections and retrieve a custom number of similar memories, wipe the collections or delete individual memories. @@ -10,8 +10,8 @@ In short, t-SNE embeds the memory points projecting them on a 2D plane such that similar points live close to each other. Namely, the most similar memories to the query are the closest points to the red one. Reducing the dimensionality of memories is necessary -since memories are stored in the [vector memory](../../../conceptual/memory/vector_memory.md) collections -in the form of multidimensional [points](../../../conceptual/memory/vector_memory.md) +since memories are stored in the [vector memory](../../../cat-components/memory/vector_memory.md) collections +in the form of multidimensional [points](../../../cat-components/memory/vector_memory.md) (e.g. points with 1536 dimensions) and for this reason cannot be plotted. ![Memory page](../../../assets/img/admin_screenshots/memory.png) @@ -35,7 +35,7 @@ Clicking on it opens a [side panel](#show-more-button) with detailed information ![Flash button](../../../assets/img/admin_screenshots/memory_details.png){ width="300" } -1. **Embedder**: this tab tells what's the [embedder](../../../conceptual/llm.md#embedding-model) in use. +1. **Embedder**: this tab tells what's the [embedder](../../../cat-components/llm.md#embedding-model) in use. 2. **Memory buttons**: these buttons allow switching between the lists of every memory collection. 3. **Memory item**: these elements give information about every the retrieved memories. In green there is the similarity score with the query; below the memory content; @@ -53,4 +53,3 @@ In green there is the similarity score with the query; below the memory content; ## References [^1]: Van der Maaten, L., & Hinton, G. (2008). Visualizing data using t-SNE. Journal of machine learning research, 9(11). - diff --git a/mkdocs/technical/basics/admin/settings.md b/mkdocs/technical/basics/admin/settings.md index 479290df9..0b9ce0319 100644 --- a/mkdocs/technical/basics/admin/settings.md +++ b/mkdocs/technical/basics/admin/settings.md @@ -1,6 +1,6 @@ # Settings -The settings page allows managing the settings of the [language models](../../../conceptual/llm.md) and other general settings. +The settings page allows managing the settings of the [language models](../../../cat-components/llm.md) and other general settings. ![Settings](../../../assets/img/admin_screenshots/settings.png) @@ -9,4 +9,4 @@ One LLM should always be configured otherwise it is not possible to chat. 2. **Embedder**: the *configure* button opens the side panel to configure your preferred LLM. By default, the Cat sets the embedder having the same vendor of the LLM you configured. When this is not available, the Cat uses an embedder that generate random numbers to embed the text. -3. **Toggle sound**: the toggle allows turning on/off the sound when the Cat sends a message. \ No newline at end of file +3. **Toggle sound**: the toggle allows turning on/off the sound when the Cat sends a message.