Refactor to clean up and move utility/legacy out of the agent (#7917)

This commit is contained in:
Engel Nyst
2025-04-18 19:53:33 +02:00
committed by GitHub
parent 76cad626ed
commit a2c55cfdef
16 changed files with 118 additions and 158 deletions

View File

@@ -57,10 +57,10 @@ class PromptManager:
return self.system_template.render().strip()
def get_example_user_message(self) -> str:
"""This is the initial user message provided to the agent
"""This is an initial user message that can be provided to the agent
before *actual* user instructions are provided.
It is used to provide a demonstration of how the agent
It can be used to provide a demonstration of how the agent
should behave in order to solve the user's task. And it may
optionally contain some additional context about the user's task.
These additional context will convert the current generic agent
@@ -69,14 +69,6 @@ class PromptManager:
return self.user_template.render().strip()
def add_examples_to_initial_message(self, message: Message) -> None:
"""Add example_message to the first user message."""
example_message = self.get_example_user_message() or None
# Insert it at the start of the TextContent list
if example_message:
message.content.insert(0, TextContent(text=example_message))
def build_workspace_context(
self,
repository_info: RepositoryInfo | None,