mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
988ef6a50e
* Initial Implementation of InvokeFunctionTool * Added unit test for InvokeFunctionTool executor. * Implemented unit and integration tests for InvokeFunctionTool. * Add sample for InvokeFunctionTool in declarative workflows. * Remove unused sample and updated comments. * Updating to official OM release with InvokeFunctionTool * Fix formatting issues. * Updated PowerFx version * Update test fixture * Cleanup - Removed unused method in InvokeFunctionToolExecutor * Update test based on PR feedback. * Update based on PR comments
53 lines
1.4 KiB
YAML
53 lines
1.4 KiB
YAML
#
|
|
# This workflow tests invoking function tools directly from a workflow.
|
|
# Uses the MenuPlugin functions: GetMenu, GetSpecials, GetItemPrice
|
|
#
|
|
kind: Workflow
|
|
trigger:
|
|
|
|
kind: OnConversationStart
|
|
id: workflow_invoke_function_tool_test
|
|
actions:
|
|
|
|
# Set the item name we want to look up
|
|
- kind: SetVariable
|
|
id: set_item_name
|
|
variable: Local.ItemName
|
|
value: Chai Tea
|
|
|
|
# Invoke GetSpecials function to get today's specials
|
|
- kind: InvokeFunctionTool
|
|
id: invoke_get_specials
|
|
functionName: GetSpecials
|
|
conversationId: =System.ConversationId
|
|
output:
|
|
autoSend: false
|
|
result: Local.Specials
|
|
|
|
# Invoke GetItemPrice function to get the price of a specific item
|
|
- kind: InvokeFunctionTool
|
|
id: invoke_get_item_price
|
|
functionName: GetItemPrice
|
|
conversationId: =System.ConversationId
|
|
arguments:
|
|
name: =Local.ItemName
|
|
output:
|
|
autoSend: true
|
|
result: Local.ItemPrice
|
|
|
|
# Ask an agent the price from the results in the conversation
|
|
- kind: InvokeAzureAgent
|
|
id: invoke_menu
|
|
conversationId: =System.ConversationId
|
|
agent:
|
|
name: TestAgent
|
|
input:
|
|
messages: =UserMessage("What's the price of Chai Tea?")
|
|
output:
|
|
messages: Local.AgentResponse
|
|
|
|
# Send the result as an activity
|
|
- kind: SendMessage
|
|
id: show_price_result
|
|
message: "{Local.AgentResponse}"
|