mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
fix: Fixes the identity prompt to be one line and add ending period after description statement
From ``` You are an agent. Your internal name is "agent". The description about you is "test description" ``` to ``` You are an agent. Your internal name is "agent". The description about you is "test description". ``` PiperOrigin-RevId: 822358196
This commit is contained in:
committed by
Copybara-Service
parent
aab2504ebd
commit
7d5c6b9acf
@@ -34,10 +34,10 @@ class _IdentityLlmRequestProcessor(BaseLlmRequestProcessor):
|
||||
self, invocation_context: InvocationContext, llm_request: LlmRequest
|
||||
) -> AsyncGenerator[Event, None]:
|
||||
agent = invocation_context.agent
|
||||
si = [f'You are an agent. Your internal name is "{agent.name}".']
|
||||
si = f'You are an agent. Your internal name is "{agent.name}".'
|
||||
if agent.description:
|
||||
si.append(f' The description about you is "{agent.description}"')
|
||||
llm_request.append_instructions(si)
|
||||
si += f' The description about you is "{agent.description}".'
|
||||
llm_request.append_instructions([si])
|
||||
|
||||
# Maintain async generator behavior
|
||||
if False: # Ensures it behaves as a generator
|
||||
|
||||
@@ -64,7 +64,8 @@ async def test_with_description():
|
||||
):
|
||||
pass
|
||||
|
||||
assert request.config.system_instruction == "\n\n".join([
|
||||
'You are an agent. Your internal name is "agent".',
|
||||
' The description about you is "test description"',
|
||||
])
|
||||
assert (
|
||||
request.config.system_instruction
|
||||
== """\
|
||||
You are an agent. Your internal name is "agent". The description about you is "test description"."""
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user