Skip to content

Commit

Permalink
add language in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
nicola-corbellini committed Dec 12, 2023
1 parent eaf91de commit 5dd8959
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
23 changes: 22 additions & 1 deletion fast_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,25 @@ def before_agent_starts(agent_input, cat):
user_name = settings["user_name"]
agent_input["chat_history"] = agent_input["chat_history"].replace("- Human:", f"- {user_name}:")

return agent_input
return agent_input


@hook
def agent_prompt_suffix(suffix, cat):
settings = cat.mad_hatter.get_plugin().load_settings()
suffix = f"""
# Context
{{episodic_memory}}
{{declarative_memory}}
{{tools_output}}
ALWAYS answer in {settings["language"]}!
## Conversation until now:{{chat_history}}
- {settings["user_name"]}: {{input}}
- AI: """

return suffix
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "C.A.T. - Cat Advanced Tools",
"version": "0.0.6",
"version": "0.0.7",
"description": "This plugin allows quickly editing some core settings such as the prompt prefix, the amount of memories retrieved and recall accuracy.",
"author_name": "FritzTheCat",
"author_url": "",
Expand Down
5 changes: 3 additions & 2 deletions settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"declarative_memory_threshold": 0.7,
"procedural_memory_k": 3,
"procedural_memory_threshold": 0.7,
"user_name": "Human"
}
"user_name": "Human",
"language": "English"
}
1 change: 1 addition & 0 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class MySettings(BaseModel):
procedural_memory_k: int = 3
procedural_memory_threshold: float = 0.7
user_name: str = "Human"
language: str = "English"

@field_validator("episodic_memory_threshold")
@classmethod
Expand Down

0 comments on commit 5dd8959

Please sign in to comment.