Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions mmv1/products/ces/Agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@ properties:
description: |-
Whether the callback is disabled. Disabled callbacks are ignored by the
agent.
- name: proactiveExecutionEnabled
type: Boolean
description: |-
If enabled, the callback will also be executed on intermediate model
outputs. This setting only affects after model callback.
**ENABLE WITH CAUTION**. Typically after model callback only needs to be
executed after receiving all model responses. Enabling proactive execution
may have negative implication on the execution cost and latency, and
should only be enabled in rare situations.
- name: pythonCode
type: String
required: true
Expand All @@ -114,6 +123,15 @@ properties:
description: |-
Whether the callback is disabled. Disabled callbacks are ignored by the
agent.
- name: proactiveExecutionEnabled
type: Boolean
description: |-
If enabled, the callback will also be executed on intermediate model
outputs. This setting only affects after model callback.
**ENABLE WITH CAUTION**. Typically after model callback only needs to be
executed after receiving all model responses. Enabling proactive execution
may have negative implication on the execution cost and latency, and
should only be enabled in rare situations.
- name: pythonCode
type: String
required: true
Expand All @@ -137,6 +155,15 @@ properties:
description: |-
Whether the callback is disabled. Disabled callbacks are ignored by the
agent.
- name: proactiveExecutionEnabled
type: Boolean
description: |-
If enabled, the callback will also be executed on intermediate model
outputs. This setting only affects after model callback.
**ENABLE WITH CAUTION**. Typically after model callback only needs to be
executed after receiving all model responses. Enabling proactive execution
may have negative implication on the execution cost and latency, and
should only be enabled in rare situations.
- name: pythonCode
type: String
required: true
Expand All @@ -159,6 +186,15 @@ properties:
description: |-
Whether the callback is disabled. Disabled callbacks are ignored by the
agent.
- name: proactiveExecutionEnabled
type: Boolean
description: |-
If enabled, the callback will also be executed on intermediate model
outputs. This setting only affects after model callback.
**ENABLE WITH CAUTION**. Typically after model callback only needs to be
executed after receiving all model responses. Enabling proactive execution
may have negative implication on the execution cost and latency, and
should only be enabled in rare situations.
- name: pythonCode
type: String
required: true
Expand All @@ -182,6 +218,15 @@ properties:
description: |-
Whether the callback is disabled. Disabled callbacks are ignored by the
agent.
- name: proactiveExecutionEnabled
type: Boolean
description: |-
If enabled, the callback will also be executed on intermediate model
outputs. This setting only affects after model callback.
**ENABLE WITH CAUTION**. Typically after model callback only needs to be
executed after receiving all model responses. Enabling proactive execution
may have negative implication on the execution cost and latency, and
should only be enabled in rare situations.
- name: pythonCode
type: String
required: true
Expand All @@ -205,6 +250,15 @@ properties:
description: |-
Whether the callback is disabled. Disabled callbacks are ignored by the
agent.
- name: proactiveExecutionEnabled
type: Boolean
description: |-
If enabled, the callback will also be executed on intermediate model
outputs. This setting only affects after model callback.
**ENABLE WITH CAUTION**. Typically after model callback only needs to be
executed after receiving all model responses. Enabling proactive execution
may have negative implication on the execution cost and latency, and
should only be enabled in rare situations.
- name: pythonCode
type: String
required: true
Expand Down
100 changes: 100 additions & 0 deletions mmv1/products/ces/AppVersion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@ properties:
Whether the callback is disabled. Disabled callbacks are ignored by the
agent.
output: true
- name: proactiveExecutionEnabled
type: Boolean
description: |-
If enabled, the callback will also be executed on intermediate model
outputs. This setting only affects after model callback.
**ENABLE WITH CAUTION**. Typically after model callback only needs to be
executed after receiving all model responses. Enabling proactive execution
may have negative implication on the execution cost and latency, and
should only be enabled in rare situations.
output: true
- name: pythonCode
type: String
description: The python code to execute for the callback.
Expand All @@ -142,6 +152,16 @@ properties:
Whether the callback is disabled. Disabled callbacks are ignored by the
agent.
output: true
- name: proactiveExecutionEnabled
type: Boolean
description: |-
If enabled, the callback will also be executed on intermediate model
outputs. This setting only affects after model callback.
**ENABLE WITH CAUTION**. Typically after model callback only needs to be
executed after receiving all model responses. Enabling proactive execution
may have negative implication on the execution cost and latency, and
should only be enabled in rare situations.
output: true
- name: pythonCode
type: String
description: The python code to execute for the callback.
Expand All @@ -168,6 +188,16 @@ properties:
Whether the callback is disabled. Disabled callbacks are ignored by the
agent.
output: true
- name: proactiveExecutionEnabled
type: Boolean
description: |-
If enabled, the callback will also be executed on intermediate model
outputs. This setting only affects after model callback.
**ENABLE WITH CAUTION**. Typically after model callback only needs to be
executed after receiving all model responses. Enabling proactive execution
may have negative implication on the execution cost and latency, and
should only be enabled in rare situations.
output: true
- name: pythonCode
type: String
description: The python code to execute for the callback.
Expand All @@ -193,6 +223,16 @@ properties:
Whether the callback is disabled. Disabled callbacks are ignored by the
agent.
output: true
- name: proactiveExecutionEnabled
type: Boolean
description: |-
If enabled, the callback will also be executed on intermediate model
outputs. This setting only affects after model callback.
**ENABLE WITH CAUTION**. Typically after model callback only needs to be
executed after receiving all model responses. Enabling proactive execution
may have negative implication on the execution cost and latency, and
should only be enabled in rare situations.
output: true
- name: pythonCode
type: String
description: The python code to execute for the callback.
Expand All @@ -219,6 +259,16 @@ properties:
Whether the callback is disabled. Disabled callbacks are ignored by the
agent.
output: true
- name: proactiveExecutionEnabled
type: Boolean
description: |-
If enabled, the callback will also be executed on intermediate model
outputs. This setting only affects after model callback.
**ENABLE WITH CAUTION**. Typically after model callback only needs to be
executed after receiving all model responses. Enabling proactive execution
may have negative implication on the execution cost and latency, and
should only be enabled in rare situations.
output: true
- name: pythonCode
type: String
description: The python code to execute for the callback.
Expand All @@ -245,6 +295,16 @@ properties:
Whether the callback is disabled. Disabled callbacks are ignored by the
agent.
output: true
- name: proactiveExecutionEnabled
type: Boolean
description: |-
If enabled, the callback will also be executed on intermediate model
outputs. This setting only affects after model callback.
**ENABLE WITH CAUTION**. Typically after model callback only needs to be
executed after receiving all model responses. Enabling proactive execution
may have negative implication on the execution cost and latency, and
should only be enabled in rare situations.
output: true
- name: pythonCode
type: String
description: The python code to execute for the callback.
Expand Down Expand Up @@ -1416,6 +1476,16 @@ properties:
Whether the callback is disabled. Disabled callbacks are ignored by the
agent.
output: true
- name: proactiveExecutionEnabled
type: Boolean
description: |-
If enabled, the callback will also be executed on intermediate model
outputs. This setting only affects after model callback.
**ENABLE WITH CAUTION**. Typically after model callback only needs to be
executed after receiving all model responses. Enabling proactive execution
may have negative implication on the execution cost and latency, and
should only be enabled in rare situations.
output: true
- name: pythonCode
type: String
description: The python code to execute for the callback.
Expand All @@ -1437,6 +1507,16 @@ properties:
Whether the callback is disabled. Disabled callbacks are ignored by the
agent.
output: true
- name: proactiveExecutionEnabled
type: Boolean
description: |-
If enabled, the callback will also be executed on intermediate model
outputs. This setting only affects after model callback.
**ENABLE WITH CAUTION**. Typically after model callback only needs to be
executed after receiving all model responses. Enabling proactive execution
may have negative implication on the execution cost and latency, and
should only be enabled in rare situations.
output: true
- name: pythonCode
type: String
description: The python code to execute for the callback.
Expand All @@ -1458,6 +1538,16 @@ properties:
Whether the callback is disabled. Disabled callbacks are ignored by the
agent.
output: true
- name: proactiveExecutionEnabled
type: Boolean
description: |-
If enabled, the callback will also be executed on intermediate model
outputs. This setting only affects after model callback.
**ENABLE WITH CAUTION**. Typically after model callback only needs to be
executed after receiving all model responses. Enabling proactive execution
may have negative implication on the execution cost and latency, and
should only be enabled in rare situations.
output: true
- name: pythonCode
type: String
description: The python code to execute for the callback.
Expand All @@ -1479,6 +1569,16 @@ properties:
Whether the callback is disabled. Disabled callbacks are ignored by the
agent.
output: true
- name: proactiveExecutionEnabled
type: Boolean
description: |-
If enabled, the callback will also be executed on intermediate model
outputs. This setting only affects after model callback.
**ENABLE WITH CAUTION**. Typically after model callback only needs to be
executed after receiving all model responses. Enabling proactive execution
may have negative implication on the execution cost and latency, and
should only be enabled in rare situations.
output: true
- name: pythonCode
type: String
description: The python code to execute for the callback.
Expand Down
12 changes: 12 additions & 0 deletions mmv1/third_party/terraform/services/ces/ces_agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,36 +172,42 @@ resource "google_ces_agent" "ces_agent_basic" {
description = "Example callback"
disabled = true
python_code = "def before_agent_callback(callback_context): return None"
proactive_execution_enabled = false
}

after_agent_callbacks {
description = "Example callback"
disabled = true
python_code = "def after_agent_callback(callback_context): return None"
proactive_execution_enabled = false
}

before_model_callbacks {
description = "Example callback"
disabled = true
python_code = "def before_model_callback(callback_context, llm_request): return None"
proactive_execution_enabled = false
}

after_model_callbacks {
description = "Example callback"
disabled = true
python_code = "def after_model_callback(callback_context, llm_response): return None"
proactive_execution_enabled = false
}

before_tool_callbacks {
description = "Example callback"
disabled = true
python_code = "def before_tool_callback(tool, input, callback_context): return None"
proactive_execution_enabled = false
}

after_tool_callbacks {
description = "Example callback"
disabled = true
python_code = "def after_tool_callback(tool, input, callback_context, tool_response): return None"
proactive_execution_enabled = false
}

tools = [
Expand Down Expand Up @@ -341,36 +347,42 @@ resource "google_ces_agent" "ces_agent_basic" {
description = "Example callback"
disabled = false
python_code = "def before_agent_callback(callback_context): return None"
proactive_execution_enabled = true
}

after_agent_callbacks {
description = "Example callback"
disabled = false
python_code = "def after_agent_callback(callback_context): return None"
proactive_execution_enabled = true
}

before_model_callbacks {
description = "Example callback"
disabled = false
python_code = "def before_model_callback(callback_context, llm_request): return None"
proactive_execution_enabled = true
}

after_model_callbacks {
description = "Example callback"
disabled = false
python_code = "def after_model_callback(callback_context, llm_response): return None"
proactive_execution_enabled = true
}

before_tool_callbacks {
description = "Example callback"
disabled = false
python_code = "def before_tool_callback(tool, input, callback_context): return None"
proactive_execution_enabled = true
}

after_tool_callbacks {
description = "Example callback"
disabled = false
python_code = "def after_tool_callback(tool, input, callback_context, tool_response): return None"
proactive_execution_enabled = true
}

// tools = [
Expand Down
Loading