From 7cfafa70af51333cfab6790cefb7776d18a9449a Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Sun, 1 Sep 2024 10:02:31 +0800 Subject: [PATCH] fix typos found by PyCharm Signed-off-by: Adrian Cole --- .gitignore | 3 +++ src/exchange/moderators/summarizer.jinja | 2 +- src/exchange/moderators/truncate.py | 2 +- tests/providers/test_anthropic.py | 2 +- tests/providers/test_bedrock.py | 4 ++-- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 82da65f..b38802d 100644 --- a/.gitignore +++ b/.gitignore @@ -141,3 +141,6 @@ docs/docs/reference # lock file uv.lock + +# PyCharm +.idea/ diff --git a/src/exchange/moderators/summarizer.jinja b/src/exchange/moderators/summarizer.jinja index f06f7fb..00c29ed 100644 --- a/src/exchange/moderators/summarizer.jinja +++ b/src/exchange/moderators/summarizer.jinja @@ -4,6 +4,6 @@ During your conversation with the user, you may be asked to summarize the conten When asked to summarize, you should concisely summarize the conversation giving emphasis to newer content. Newer content will be towards the end of the conversation. Preferentially keep user supplied content in the summary. -The summary *MUST* include filenames that were touched and/or modifed. If the updates occured more recently, keep the latest modifications made to the files in the summary. If the changes occured earlier in the chat, briefly summarize the changes and don't include the changes in the summary. +The summary *MUST* include filenames that were touched and/or modified. If the updates occurred more recently, keep the latest modifications made to the files in the summary. If the changes occurred earlier in the chat, briefly summarize the changes and don't include the changes in the summary. There will likely be json formatted blocks referencing ToolUse and ToolResults. You can ignore ToolUse references, but keep the ToolResult outputs, summarizing as needed and with the same guidelines as above. diff --git a/src/exchange/moderators/truncate.py b/src/exchange/moderators/truncate.py index 6a962c1..029d351 100644 --- a/src/exchange/moderators/truncate.py +++ b/src/exchange/moderators/truncate.py @@ -55,5 +55,5 @@ def rewrite(self, exchange: Type["exchange.exchange.Exchange"]) -> None: # noqa if exchange.messages[0].tool_result: pop_checkpoint(exchange, exclude_last=1) - # Update the token count on the the first checkpoint to reflect the system prompt + # Update the token count on the first checkpoint to reflect the system prompt exchange.checkpoints[0].token_count += self.system_prompt_token_count diff --git a/tests/providers/test_anthropic.py b/tests/providers/test_anthropic.py index d72a9fb..37ea051 100644 --- a/tests/providers/test_anthropic.py +++ b/tests/providers/test_anthropic.py @@ -175,4 +175,4 @@ def test_anthropic_integration(): reply = provider.complete(model=model, system=system, messages=messages) assert reply[0].content is not None - print("Completion content from Anthropics:", reply[0].content) + print("Completion content from Anthropic:", reply[0].content) diff --git a/tests/providers/test_bedrock.py b/tests/providers/test_bedrock.py index bdc8cdf..2525f65 100644 --- a/tests/providers/test_bedrock.py +++ b/tests/providers/test_bedrock.py @@ -113,7 +113,7 @@ def test_message_to_bedrock_spec_tool_result(bedrock_provider): def test_message_to_bedrock_spec_tool_result_text(bedrock_provider): - tool_result = ToolResult(tool_use_id="tool-1", output="Error occured", is_error=True) + tool_result = ToolResult(tool_use_id="tool-1", output="Error occurred", is_error=True) message = Message(role="user", content=[tool_result]) expected = { "role": "user", @@ -121,7 +121,7 @@ def test_message_to_bedrock_spec_tool_result_text(bedrock_provider): { "toolResult": { "toolUseId": "tool-1", - "content": [{"text": "Error occured"}], + "content": [{"text": "Error occurred"}], "status": "error", } }