@@ -1445,7 +1445,10 @@ def decorator():
1445
1445
1446
1446
def assistant_skill_trigger (self ,
1447
1447
arg_name : str ,
1448
- task_description : str ,
1448
+ function_description : str ,
1449
+ function_name : Optional [str ] = None ,
1450
+ parameter_description_json : Optional [str ] = None , # NoQA
1451
+ model : Optional [OpenAIModels ] = OpenAIModels .DefaultChatModel , # NoQA
1449
1452
data_type : Optional [
1450
1453
Union [DataType , str ]] = None ,
1451
1454
** kwargs : Any ) -> Callable [..., Any ]:
@@ -1459,16 +1462,22 @@ def assistant_skill_trigger(self,
1459
1462
You can define functions that can be triggered by assistants by using
1460
1463
1461
1464
the `assistantSkillTrigger` trigger binding. These functions are
1462
- invoked by the extension when a assistant signals that it would like
1465
+ invoked by the extension when an assistant signals that it would like
1463
1466
to invoke a function in response to a user prompt.
1464
1467
1465
1468
The name of the function, the description provided by the trigger,
1466
1469
and the parameter name are all hints that the underlying language model
1467
1470
use to determine when and how to invoke an assistant function.
1468
1471
1469
- :param arg_name: The name of the variable that represents
1472
+ :param arg_name: The name of trigger parameter in the function code.
1470
1473
:param function_description: The description of the assistant function,
1471
1474
which is provided to the model.
1475
+ :param function_name: The assistant function, which is provided to the
1476
+ LLM.
1477
+ :param parameter_description_json: A JSON description of the function
1478
+ parameter, which is provided to the LLM.
1479
+ If no description is provided, the description will be autogenerated.
1480
+ :param model: The OpenAI chat model to use.
1472
1481
:param data_type: Defines how Functions runtime should treat the
1473
1482
parameter value.
1474
1483
:param kwargs: Keyword arguments for specifying additional binding
@@ -1483,7 +1492,7 @@ def decorator():
1483
1492
fb .add_trigger (
1484
1493
trigger = AssistantSkillTrigger (
1485
1494
name = arg_name ,
1486
- function_description = task_description ,
1495
+ function_description = function_description ,
1487
1496
data_type = parse_singular_param_to_enum (data_type ,
1488
1497
DataType ),
1489
1498
** kwargs ))
@@ -2813,8 +2822,7 @@ def text_completion_input(self,
2813
2822
the function, which then returns the result text as the response
2814
2823
content.
2815
2824
2816
- :param arg_name: The name of the variable that represents DaprState
2817
- output object in function code.
2825
+ :param arg_name: The name of binding parameter in the function code.
2818
2826
:param prompt: The prompt to generate completions for, encoded as a
2819
2827
string.
2820
2828
:param model: the ID of the model to use.
@@ -2867,8 +2875,7 @@ def assistant_create_output(self, arg_name: str,
2867
2875
The assistantCreate output binding creates a new assistant with a
2868
2876
specified system prompt.
2869
2877
2870
- :param arg_name: The name of the variable that represents DaprState
2871
- output object in function code.
2878
+ :param arg_name: The name of binding parameter in the function code.
2872
2879
:param data_type: Defines how Functions runtime should treat the
2873
2880
parameter value
2874
2881
:param kwargs: Keyword arguments for specifying additional binding
@@ -2904,8 +2911,7 @@ def assistant_query_input(self,
2904
2911
The assistantQuery input binding fetches the assistant history and
2905
2912
passes it to the function.
2906
2913
2907
- :param arg_name: The name of the variable that represents DaprState
2908
- output object in function code.
2914
+ :param arg_name: The name of binding parameter in the function code.
2909
2915
:param timestamp_utc: the timestamp of the earliest message in the chat
2910
2916
history to fetch. The timestamp should be in ISO 8601 format - for
2911
2917
example, 2023-08-01T00:00:00Z.
@@ -2947,8 +2953,7 @@ def assistant_post_input(self, arg_name: str,
2947
2953
The assistantPost output binding sends a message to the assistant and
2948
2954
saves the response in its internal state.
2949
2955
2950
- :param arg_name: The name of the variable that represents DaprState
2951
- output object in function code.
2956
+ :param arg_name: The name of binding parameter in the function code.
2952
2957
:param id: The ID of the assistant to update.
2953
2958
:param user_message: The user message that user has entered for
2954
2959
assistant to respond to.
@@ -2992,12 +2997,11 @@ def embeddings_input(self,
2992
2997
-> Callable [..., Any ]:
2993
2998
"""
2994
2999
The embeddings input decorator creates embeddings which will be used to
2995
- measure the readiness of text strings.
3000
+ measure the relatedness of text strings.
2996
3001
2997
3002
Ref: https://platform.openai.com/docs/guides/embeddings
2998
3003
2999
- :param arg_name: The name of the variable that represents DaprState
3000
- output object in function code.
3004
+ :param arg_name: The name of binding parameter in the function code.
3001
3005
:param input: The input source containing the data to generate
3002
3006
embeddings for.
3003
3007
:param input_type: The type of the input.
@@ -3048,13 +3052,17 @@ def semantic_search_input(self,
3048
3052
** kwargs ) \
3049
3053
-> Callable [..., Any ]:
3050
3054
"""
3051
- The embeddings input decorator creates embeddings which will be used to
3052
- measure the readiness of text strings.
3055
+ The semantic search feature allows you to import documents into a
3056
+ vector database using an output binding and query the documents in that
3057
+ database using an input binding. For example, you can have a function
3058
+ that imports documents into a vector database and another function that
3059
+ issues queries to OpenAI using content stored in the vector database as
3060
+ context (also known as the Retrieval Augmented Generation, or RAG
3061
+ technique).
3053
3062
3054
3063
Ref: https://platform.openai.com/docs/guides/embeddings
3055
3064
3056
- :param arg_name: The name of the variable that represents DaprState
3057
- output object in function code.
3065
+ :param arg_name: The name of binding parameter in the function code.
3058
3066
:param connection_name: app setting or environment variable which
3059
3067
contains a connection string value.
3060
3068
:param collection: The name of the collection or table to search or
@@ -3064,7 +3072,7 @@ def semantic_search_input(self,
3064
3072
The default value is "text-embedding-ada-002".
3065
3073
:param chat_model: The name of the Large Language Model to invoke for
3066
3074
chat responses. The default value is "gpt-3.5-turbo".
3067
- :param system_prompt: Optional The system prompt to use for prompting
3075
+ :param system_prompt: Optional. The system prompt to use for prompting
3068
3076
the large language model.
3069
3077
:param max_knowledge_count: Optional. The number of knowledge items to
3070
3078
inject into the SystemPrompt. Default value: 1
@@ -3121,8 +3129,7 @@ def embeddings_store_output(self,
3121
3129
- Azure Data Explorer
3122
3130
- Azure Cosmos DB using MongoDB
3123
3131
3124
- :param arg_name: The name of the variable that represents DaprState
3125
- output object in function code.
3132
+ :param arg_name: The name of binding parameter in the function code.
3126
3133
:param input: The input to generate embeddings for.
3127
3134
:param input_type: The type of the input.
3128
3135
:param connection_name: The name of an app setting or environment
0 commit comments