Skip to main content

Class: TogetherLLM

Unified language model interface

Extends

Constructors

new TogetherLLM()

new TogetherLLM(init?): TogetherLLM

Parameters

init?: Partial<OpenAI>

Returns

TogetherLLM

Overrides

OpenAI.constructor

Defined in

packages/llamaindex/src/llm/together.ts:5

Properties

additionalChatOptions?

optional additionalChatOptions: OpenAIAdditionalChatOptions

Inherited from

OpenAI.additionalChatOptions

Defined in

packages/llamaindex/src/llm/openai.ts:176


additionalSessionOptions?

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

Inherited from

OpenAI.additionalSessionOptions

Defined in

packages/llamaindex/src/llm/openai.ts:183


apiKey?

optional apiKey: string = undefined

Inherited from

OpenAI.apiKey

Defined in

packages/llamaindex/src/llm/openai.ts:179


maxRetries

maxRetries: number

Inherited from

OpenAI.maxRetries

Defined in

packages/llamaindex/src/llm/openai.ts:180


maxTokens?

optional maxTokens: number

Inherited from

OpenAI.maxTokens

Defined in

packages/llamaindex/src/llm/openai.ts:175


model

model: ChatModel | string & object

Inherited from

OpenAI.model

Defined in

packages/llamaindex/src/llm/openai.ts:169


session

session: OpenAISession

Inherited from

OpenAI.session

Defined in

packages/llamaindex/src/llm/openai.ts:182


temperature

temperature: number

Inherited from

OpenAI.temperature

Defined in

packages/llamaindex/src/llm/openai.ts:173


timeout?

optional timeout: number

Inherited from

OpenAI.timeout

Defined in

packages/llamaindex/src/llm/openai.ts:181


topP

topP: number

Inherited from

OpenAI.topP

Defined in

packages/llamaindex/src/llm/openai.ts:174

Accessors

metadata

get metadata(): LLMMetadata

Returns

LLMMetadata

Inherited from

OpenAI.metadata

Defined in

packages/llamaindex/src/llm/openai.ts:239


supportToolCall

get supportToolCall(): boolean

Returns

boolean

Inherited from

OpenAI.supportToolCall

Defined in

packages/llamaindex/src/llm/openai.ts:235

Methods

chat()

chat(params)

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

Get a chat response from the LLM

Parameters

params: LLMChatParamsStreaming<OpenAIAdditionalChatOptions, ToolCallLLMMessageOptions>

Returns

Promise<AsyncIterable<ChatResponseChunk<ToolCallLLMMessageOptions>>>

Inherited from

OpenAI.chat

Defined in

packages/llamaindex/src/llm/openai.ts:316

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/llamaindex/src/llm/openai.ts:322


complete()

complete(params)

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

Get a prompt completion from the LLM

Parameters

params: LLMCompletionParamsStreaming

Returns

Promise<AsyncIterable<CompletionResponse>>

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>>

Parameters

baseRequestParams: ChatCompletionCreateParams

Returns

AsyncIterable<ChatResponseChunk<ToolCallLLMMessageOptions>>

Inherited from

OpenAI.streamChat

Defined in

packages/llamaindex/src/llm/openai.ts:398


toOpenAIMessage()

static toOpenAIMessage(messages): ChatCompletionMessageParam[]

Parameters

messages: ChatMessage<ToolCallLLMMessageOptions>[]

Returns

ChatCompletionMessageParam[]

Inherited from

OpenAI.toOpenAIMessage

Defined in

packages/llamaindex/src/llm/openai.ts:267


toOpenAIRole()

static toOpenAIRole(messageType): ChatCompletionRole

Parameters

messageType: MessageType

Returns

ChatCompletionRole

Inherited from

OpenAI.toOpenAIRole

Defined in

packages/llamaindex/src/llm/openai.ts:254


toTool()

static toTool(tool): ChatCompletionTool

Parameters

tool: BaseTool<any>

Returns

ChatCompletionTool

Inherited from

OpenAI.toTool

Defined in

packages/llamaindex/src/llm/openai.ts:468