Skip to content
This repository was archived by the owner on Dec 11, 2025. It is now read-only.

Commit d96c08e

Browse files
committed
refactor: Remove unused O1 model translation function from prompts and client
- Deleted the o1_system_prompt_translate function from prompts.py. - Removed references to the O1 model translation in client.py to streamline the codebase.
1 parent c00d7ec commit d96c08e

2 files changed

Lines changed: 0 additions & 22 deletions

File tree

notdiamond/llms/client.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
from notdiamond.prompts import (
4343
_curly_escape,
4444
inject_system_prompt,
45-
o1_system_prompt_translate,
4645
)
4746
from notdiamond.types import NDApiKeyValidator
4847

@@ -906,8 +905,6 @@ def invoke(
906905
messages, best_llm.system_prompt
907906
)
908907

909-
messages = o1_system_prompt_translate(messages, best_llm)
910-
911908
self.call_callbacks("on_model_select", best_llm, best_llm.model)
912909

913910
llm = self._llm_from_config(best_llm, callbacks=self.callbacks)
@@ -1109,8 +1106,6 @@ async def ainvoke(
11091106
messages, best_llm.system_prompt
11101107
)
11111108

1112-
messages = o1_system_prompt_translate(messages, best_llm)
1113-
11141109
self.call_callbacks("on_model_select", best_llm, best_llm.model)
11151110

11161111
llm = self._llm_from_config(best_llm, callbacks=self.callbacks)

notdiamond/prompts.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
import re
33
from typing import Dict, List
44

5-
from notdiamond.llms.config import LLMConfig
6-
from notdiamond.llms.providers import is_o1_model
7-
85
LOGGER = logging.getLogger(__name__)
96
LOGGER.setLevel(logging.INFO)
107

@@ -37,17 +34,3 @@ def _curly_escape(text: str) -> str:
3734
return re.sub(r"(?<!{){([a-zA-Z])}(?!})", r"{{\1}}", text)
3835

3936

40-
def o1_system_prompt_translate(
41-
messages: List[Dict[str, str]], llm: LLMConfig
42-
) -> List[Dict[str, str]]:
43-
if is_o1_model(llm):
44-
translated_messages = []
45-
for msg in messages:
46-
if msg["role"] == "system":
47-
translated_messages.append(
48-
{"role": "user", "content": msg["content"]}
49-
)
50-
else:
51-
translated_messages.append(msg)
52-
return translated_messages
53-
return messages

0 commit comments

Comments
 (0)