Created
December 16, 2025 17:40
-
-
Save kennethleungty/0dec0c55659eda34f4abfc15b16874b0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def wrap_model_call( | |
| self, | |
| request: ModelRequest, | |
| handler: Callable[[ModelRequest], ModelResponse], | |
| ) -> ModelCallResult: | |
| """Update the system message to include the todo system prompt.""" | |
| if request.system_message is not None: | |
| new_system_content = [ | |
| *request.system_message.content_blocks, | |
| {"type": "text", "text": f"\n\n{self.system_prompt}"}, | |
| ] | |
| else: | |
| new_system_content = [{"type": "text", "text": self.system_prompt}] | |
| new_system_message = SystemMessage( | |
| content=cast("list[str | dict[str, str]]", new_system_content) | |
| ) | |
| return handler(request.override(system_message=new_system_message)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment