Skip to content

Commit

Permalink
🛠️ Small fixes
Browse files Browse the repository at this point in the history
- Fix language problem
- Allow to clean history
  • Loading branch information
levy42 committed Jul 4, 2024
1 parent 10d62e7 commit 6e27c57
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions lang_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
DEBUG = False

CHAT_PROMPT = """
You are an AI assistant connecting a user and a following programming interface:
You are an AI assistant connecting a user and a following python programming interface:
## Description:
{description}
## Operations:
Expand All @@ -32,7 +32,6 @@
User might ask questions, not related to provided interface, so act as a simple AI assistant, answer:
<ANOTHER>answer</ANOTHER>
Use the same language as user's request.
""" # noqa
FUNCTION_PROMPT = """
You are an AI assistant connecting a user and a following programming interface:
Expand All @@ -58,7 +57,6 @@
2. <CALL>function(**params)</CALL>
3. <CLARIFY>question</CLARIFY>
Use the same language as user's request.
""" # noqa
FUNCTION_PROMPT_USER = """
<QUESTION>question</QUESTION>
Expand Down Expand Up @@ -148,6 +146,9 @@ def handle(self, question: str) -> str:
self._messages.append({'role': 'assistant', 'content': final_result})
return final_result

def clen_history(self):
self._messages = self._messages[:1]

def _trim_messages(self):
char_used = 0
new_messages = []
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "lang_interface"
version = "0.0.2"
version = "0.0.3"
description = "Integrate a Python programming interface with an LLM Assistant"
readme = "README.md"
keywords = ["llm", "assistant"]
Expand Down

0 comments on commit 6e27c57

Please sign in to comment.