Class AzureOpenAI<CallOptions>

⚠️ Deprecated ⚠️

Import from "@langchain/openai" instead.

This feature is deprecated and will be removed in the future.

It is not recommended for use.

Type Parameters

Hierarchy (view full)

Implements

Constructors

Properties

batchSize: number = 20

Batch size to use when passing multiple documents to generate

frequencyPenalty: number = 0

A value that influences the probability of generated tokens appearing based on their cumulative frequency in generated text. Positive values will make tokens less likely to appear as their frequency increases and decrease the likelihood of the model repeating the same statements verbatim.

maxTokens: number = 256

Maximum number of tokens to generate in the completion. -1 returns as many tokens as possible given the prompt and the model's maximum context size.

model: string = "gpt-3.5-turbo-instruct"

Model name to use

modelName: string = "gpt-3.5-turbo-instruct"

Model name to use Alias for model

n: number = 1

The number of completions choices that should be generated per provided prompt as part of an overall completions response. Because this setting can generate many completions, it may quickly consume your token quota. Use carefully and ensure reasonable settings for max_tokens and stop.

presencePenalty: number = 0

A value that influences the probability of generated tokens appearing based on their existing presence in generated text. Positive values will make tokens less likely to appear when they already exist and increase the model's likelihood to output new topics.

streaming: boolean = false

Whether to stream the results or not. Enabling disables tokenUsage reporting

temperature: number = 0.7

The sampling temperature to use that controls the apparent creativity of generated completions. Higher values will make output more random while lower values will make results more focused and deterministic. It is not recommended to modify temperature and top_p for the same completions request as the interaction of these two settings is difficult to predict.

topP: number = 1

An alternative to sampling with temperature called nucleus sampling. This value causes the model to consider the results of tokens with the provided probability mass. As an example, a value of 0.15 will cause only the tokens comprising the top 15% of probability mass to be considered. It is not recommended to modify temperature and top_p for the same completions request as the interaction of these two settings is difficult to predict.

apiKey?: string

API key to use when making requests to Azure OpenAI.

azureOpenAIApiDeploymentName?: string

Azure OpenAI API deployment name to use for completions when making requests to Azure OpenAI. This is the name of the deployment you created in the Azure portal. e.g. "my-openai-deployment" this will be used in the endpoint URL: https://{InstanceName}.openai.azure.com/openai/deployments/my-openai-deployment/

azureOpenAIApiKey?: string

API key to use when making requests to Azure OpenAI. Alias for apiKey

azureOpenAIEndpoint?: string

Endpoint to use when making requests to Azure OpenAI

bestOf?: number

A value that controls how many completions will be internally generated prior to response formulation. When used together with n, best_of controls the number of candidate completions and must be greater than n. Because this setting can generate many completions, it may quickly consume your token quota. Use carefully and ensure reasonable settings for max_tokens and stop.

echo?: boolean

A value specifying whether completions responses should include input prompts as prefixes to their generated output.

logitBias?: Record<string, number>

A map between GPT token IDs and bias scores that influences the probability of specific tokens appearing in a completions response. Token IDs are computed via external tokenizer tools, while bias scores reside in the range of -100 to 100 with minimum and maximum values corresponding to a full ban or exclusive selection of a token, respectively. The exact behavior of a given bias score varies by model.

logprobs?: number

A value that controls the emission of log probabilities for the provided number of most likely tokens within a completions response.

modelKwargs?: Record<string, any>

Holds any additional parameters that are valid to pass to openai.createCompletion that are not explicitly specified on this class.

stop?: string[]

A collection of textual sequences that will end completions generation.

stopSequences?: string[]

A collection of textual sequences that will end completions generation.

timeout?: number

Timeout to use when making requests to OpenAI.

user?: string

An identifier for the caller or end user of the operation. This may be used for tracking or rate-limiting purposes.

Accessors

Generated using TypeDoc