Skip to main content

Class: DeepInfra

Unified language model interface

Extends

Constructors

new DeepInfra()

new DeepInfra(init?): DeepInfra

Parameters

init?: Partial<OpenAI>

Returns

DeepInfra

Overrides

OpenAI.constructor

Defined in

packages/llamaindex/src/llm/deepinfra.ts:9

Properties

additionalChatOptions?

optional additionalChatOptions: OpenAIAdditionalChatOptions

Inherited from

OpenAI.additionalChatOptions

Defined in

packages/llm/openai/dist/index.d.ts:224


additionalSessionOptions?

optional additionalSessionOptions: Omit<Partial<ClientOptions>, "apiKey" | "maxRetries" | "timeout">

Inherited from

OpenAI.additionalSessionOptions

Defined in

packages/llm/openai/dist/index.d.ts:229


apiKey?

optional apiKey: string

Inherited from

OpenAI.apiKey

Defined in

packages/llm/openai/dist/index.d.ts:225


maxRetries

maxRetries: number

Inherited from

OpenAI.maxRetries

Defined in

packages/llm/openai/dist/index.d.ts:226


maxTokens?

optional maxTokens: number

Inherited from

OpenAI.maxTokens

Defined in

packages/llm/openai/dist/index.d.ts:223


model

model: string & object | ChatModel

Inherited from

OpenAI.model

Defined in

packages/llm/openai/dist/index.d.ts:220


session

session: OpenAISession

Inherited from

OpenAI.session

Defined in

packages/llm/openai/dist/index.d.ts:228


temperature

temperature: number

Inherited from

OpenAI.temperature

Defined in

packages/llm/openai/dist/index.d.ts:221


timeout?

optional timeout: number

Inherited from

OpenAI.timeout

Defined in

packages/llm/openai/dist/index.d.ts:227


topP

topP: number

Inherited from

OpenAI.topP

Defined in

packages/llm/openai/dist/index.d.ts:222

Accessors

metadata

get metadata(): LLMMetadata

Returns

LLMMetadata

Inherited from

OpenAI.metadata

Defined in

packages/llm/openai/dist/index.d.ts:234


supportToolCall

get supportToolCall(): boolean

Returns

boolean

Inherited from

OpenAI.supportToolCall

Defined in

packages/llm/openai/dist/index.d.ts:233

Methods

chat()

chat(params)

chat(params): Promise<AsyncIterable<ChatResponseChunk<ToolCallLLMMessageOptions>, any, any>>

Get a chat response from the LLM

Parameters

params: LLMChatParamsStreaming<OpenAIAdditionalChatOptions, ToolCallLLMMessageOptions>

Returns

Promise<AsyncIterable<ChatResponseChunk<ToolCallLLMMessageOptions>, any, any>>

Inherited from

OpenAI.chat

Defined in

packages/llm/openai/dist/index.d.ts:237

chat(params)

chat(params): Promise<ChatResponse<ToolCallLLMMessageOptions>>

Get a chat response from the LLM

Parameters

params: LLMChatParamsNonStreaming<OpenAIAdditionalChatOptions, ToolCallLLMMessageOptions>

Returns

Promise<ChatResponse<ToolCallLLMMessageOptions>>

Inherited from

OpenAI.chat

Defined in

packages/llm/openai/dist/index.d.ts:238


complete()

complete(params)

complete(params): Promise<AsyncIterable<CompletionResponse, any, any>>

Get a prompt completion from the LLM

Parameters

params: LLMCompletionParamsStreaming

Returns

Promise<AsyncIterable<CompletionResponse, any, any>>

Inherited from

OpenAI.complete

Defined in

packages/core/dist/llms/index.d.ts:168

complete(params)

complete(params): Promise<CompletionResponse>

Get a prompt completion from the LLM

Parameters

params: LLMCompletionParamsNonStreaming

Returns

Promise<CompletionResponse>

Inherited from

OpenAI.complete

Defined in

packages/core/dist/llms/index.d.ts:169


streamChat()

protected streamChat(baseRequestParams): AsyncIterable<ChatResponseChunk<ToolCallLLMMessageOptions>, any, any>

Parameters

baseRequestParams: ChatCompletionCreateParams

Returns

AsyncIterable<ChatResponseChunk<ToolCallLLMMessageOptions>, any, any>

Inherited from

OpenAI.streamChat

Defined in

packages/llm/openai/dist/index.d.ts:239


toOpenAIMessage()

static toOpenAIMessage(messages): ChatCompletionMessageParam[]

Parameters

messages: ChatMessage<ToolCallLLMMessageOptions>[]

Returns

ChatCompletionMessageParam[]

Inherited from

OpenAI.toOpenAIMessage

Defined in

packages/llm/openai/dist/index.d.ts:236


toOpenAIRole()

static toOpenAIRole(messageType): ChatCompletionRole

Parameters

messageType: MessageType

Returns

ChatCompletionRole

Inherited from

OpenAI.toOpenAIRole

Defined in

packages/llm/openai/dist/index.d.ts:235


toTool()

static toTool(tool): ChatCompletionTool

Parameters

tool: BaseTool<any>

Returns

ChatCompletionTool

Inherited from

OpenAI.toTool

Defined in

packages/llm/openai/dist/index.d.ts:240