Skip to content

Add OAIToolsToList

dfinke edited this page Apr 20, 2024 · 2 revisions

Add-OAIToolsToList

SYNOPSIS

Adds tools and functions to a list for use with OpenAI Assistants.

SYNTAX

Add-OAIToolsToList [[-Tools] <Object>] [[-FunctionJson] <Object>] [-Body] <Hashtable>
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

The Add-OAIToolsToList function is used to add tools and functions to a list, which can be used with OpenAI Assistants. It takes in parameters for the tools, function JSON, and a hashtable representing the body of the request. The function then constructs a list of tools and functions based on the provided parameters and updates the 'tools' property of the body hashtable.

EXAMPLES

EXAMPLE 1

Add-OAIToolsToList -Tools 'spellcheck' -FunctionJson @('{"type": "function", "function": "function_json"}') -Body $body
Adds the 'spellcheck' tool and a function JSON object to the list of tools in the body hashtable.

PARAMETERS

-Tools

An optional array of strings representing the tools to be added to the list.

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-FunctionJson

An optional array of function JSON objects representing the functions to be added to the list.

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Body

A mandatory hashtable representing the body of the request.

Type: Hashtable
Parameter Sets: (All)
Aliases:

Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES

RELATED LINKS

https://platform.openai.com/docs/assistants/tools/defining-functions

Clone this wiki locally