in azure/functions/decorators/function_app.py [0:0]
def embeddings_input(self,
arg_name: str,
input: str,
input_type: InputType,
model: Optional[str] = None,
max_chunk_length: Optional[int] = 8 * 1024,
max_overlap: Optional[int] = 128,
data_type: Optional[
Union[DataType, str]] = None,
**kwargs) \
-> Callable[..., Any]:
"""
The embeddings input decorator creates embeddings which will be used to
measure the relatedness of text strings.
Ref: https://platform.openai.com/docs/guides/embeddings
:param arg_name: The name of binding parameter in the function code.
:param input: The input source containing the data to generate
embeddings for.
:param input_type: The type of the input.
:param model: The ID of the model to use.
:param max_chunk_length: The maximum number of characters to chunk the
input into. Default value: 8 * 1024
:param max_overlap: The maximum number of characters to overlap
between chunks. Default value: 128
:param data_type: Defines how Functions runtime should treat the
parameter value
:param kwargs: Keyword arguments for specifying additional binding
fields to include in the binding json
:return: Decorator function.
"""
@self._configure_function_builder
def wrap(fb):
def decorator():
fb.add_binding(
binding=EmbeddingsInput(
name=arg_name,
input=input,
input_type=input_type,
model=model,
max_chunk_length=max_chunk_length,
max_overlap=max_overlap,
data_type=parse_singular_param_to_enum(data_type,
DataType),
**kwargs))
return fb
return decorator()
return wrap