Skip to content

Get OAIFileContent

dfinke edited this page Apr 20, 2024 · 2 revisions

Get-OAIFileContent

SYNOPSIS

Retrieves the content of a file from the OpenAI API.

SYNTAX

Get-OAIFileContent [-FileId] <Object> [[-ContentType] <Object>] [[-OutFile] <Object>]
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

The Get-OAIFileContent function retrieves the content of a file from the OpenAI API using the specified FileId. The content can be returned as plain text or in a specified content type. Optionally, the content can be saved to a file.

EXAMPLES

EXAMPLE 1

Get-OAIFileContent -FileId "abc123" -ContentType "application/json" -OutFile "C:\output.json"
Retrieves the content of the file with ID "abc123" from the OpenAI API as JSON and saves it to "C:\output.json".

PARAMETERS

-FileId

The ID of the file to retrieve the content from.

Type: Object
Parameter Sets: (All)
Aliases:

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

-ContentType

The type of content to retrieve. The default value is "text/plain".

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: Text/plain
Accept pipeline input: False
Accept wildcard characters: False

-OutFile

The path to save the content to. If specified, the content will be saved to the specified file.

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
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/api-reference/files/retrieve-contents

Clone this wiki locally