mirror of
https://github.com/EvolutionAPI/adk-python.git
synced 2025-12-19 03:42:22 -06:00
Prevent session state injection for provider supplied instructions
When the user provides instruction provider, we assume that they will inject the session state parameters if needed. This assumption allows users to return code snippets in the instruction provider without any template replacement. PiperOrigin-RevId: 759705471
This commit is contained in:
committed by
Copybara-Service
parent
5ee17a3268
commit
9e9dfa7472
@@ -61,6 +61,8 @@ async def test_function_system_instruction():
|
||||
def build_function_instruction(readonly_context: ReadonlyContext) -> str:
|
||||
return (
|
||||
"This is the function agent instruction for invocation:"
|
||||
" provider template intact { customerId }"
|
||||
" provider template intact { customer_int }"
|
||||
f" {readonly_context.invocation_id}."
|
||||
)
|
||||
|
||||
@@ -88,10 +90,12 @@ async def test_function_system_instruction():
|
||||
pass
|
||||
|
||||
assert request.config.system_instruction == (
|
||||
"This is the function agent instruction for invocation: test_id."
|
||||
"This is the function agent instruction for invocation:"
|
||||
" provider template intact { customerId }"
|
||||
" provider template intact { customer_int }"
|
||||
" test_id."
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_async_function_system_instruction():
|
||||
async def build_function_instruction(
|
||||
@@ -99,6 +103,8 @@ async def test_async_function_system_instruction():
|
||||
) -> str:
|
||||
return (
|
||||
"This is the function agent instruction for invocation:"
|
||||
" provider template intact { customerId }"
|
||||
" provider template intact { customer_int }"
|
||||
f" {readonly_context.invocation_id}."
|
||||
)
|
||||
|
||||
@@ -126,7 +132,10 @@ async def test_async_function_system_instruction():
|
||||
pass
|
||||
|
||||
assert request.config.system_instruction == (
|
||||
"This is the function agent instruction for invocation: test_id."
|
||||
"This is the function agent instruction for invocation:"
|
||||
" provider template intact { customerId }"
|
||||
" provider template intact { customer_int }"
|
||||
" test_id."
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user