This repository was archived by the owner on Jun 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
src/codegate/types/anthropic
tests/integration/anthropic Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -219,12 +219,14 @@ def get_system_prompt(self) -> Iterable[str]:
219219 break # TODO this must be changed
220220
221221 def set_system_prompt (self , text ) -> None :
222- if isinstance (self .system , str ):
222+ if isinstance (self .system , ( str , type ( None )) ):
223223 self .system = text
224224 if isinstance (self .system , list ):
225225 self .system [0 ].text = text
226226
227227 def add_system_prompt (self , text , sep = "\n " ) -> None :
228+ if isinstance (self .system , type (None )):
229+ self .system = text
228230 if isinstance (self .system , str ):
229231 self .system = f"{ self .system } { sep } { text } "
230232 if isinstance (self .system , list ):
Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ testcases:
8888 url : http://127.0.0.1:8989/anthropic/messages
8989 data : |
9090 {
91+ "max_tokens":4096,
9192 "messages":[
9293 {
9394 "content":"Generate me example code using the python invokehttp package to call an API",
@@ -108,6 +109,7 @@ testcases:
108109 url : http://127.0.0.1:8989/anthropic/messages
109110 data : |
110111 {
112+ "max_tokens":4096,
111113 "messages": [
112114 {
113115 "role": "user",
You can’t perform that action at this time.
0 commit comments