跳到主要内容

Class: Groq

OpenAI LLM implementation

Hierarchy

Constructors

constructor

new Groq(init?): Groq

Parameters

NameType
init?Partial<OpenAI>

Returns

Groq

Overrides

OpenAI.constructor

Defined in

packages/core/src/llm/groq.ts:5

Properties

additionalChatOptions

Optional additionalChatOptions: Omit<Partial<ChatCompletionCreateParams>, "messages" | "stream" | "max_tokens" | "model" | "temperature" | "top_p" | "tools" | "toolChoice">

Inherited from

OpenAI.additionalChatOptions

Defined in

packages/core/src/llm/LLM.ts:82


additionalSessionOptions

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

Inherited from

OpenAI.additionalSessionOptions

Defined in

packages/core/src/llm/LLM.ts:99


apiKey

Optional apiKey: string = undefined

Inherited from

OpenAI.apiKey

Defined in

packages/core/src/llm/LLM.ts:95


maxRetries

maxRetries: number

Inherited from

OpenAI.maxRetries

Defined in

packages/core/src/llm/LLM.ts:96


maxTokens

Optional maxTokens: number

Inherited from

OpenAI.maxTokens

Defined in

packages/core/src/llm/LLM.ts:81


model

model: string

Inherited from

OpenAI.model

Defined in

packages/core/src/llm/LLM.ts:78


session

session: OpenAISession

Inherited from

OpenAI.session

Defined in

packages/core/src/llm/LLM.ts:98


temperature

temperature: number

Inherited from

OpenAI.temperature

Defined in

packages/core/src/llm/LLM.ts:79


timeout

Optional timeout: number

Inherited from

OpenAI.timeout

Defined in

packages/core/src/llm/LLM.ts:97


topP

topP: number

Inherited from

OpenAI.topP

Defined in

packages/core/src/llm/LLM.ts:80

Accessors

metadata

get metadata(): Object

Returns

Object

NameType
contextWindownumber
isFunctionCallingModelboolean
maxTokensundefined | number
modelstring
temperaturenumber
tokenizerCL100K_BASE
topPnumber

Inherited from

OpenAI.metadata

Defined in

packages/core/src/llm/LLM.ts:157

Methods

chat

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

Parameters

NameType
paramsLLMChatParamsStreaming

Returns

Promise<AsyncIterable<ChatResponseChunk>>

Inherited from

OpenAI.chat

Defined in

packages/core/src/llm/LLM.ts:209

chat(params): Promise<ChatResponse>

Parameters

NameType
paramsLLMChatParamsNonStreaming

Returns

Promise<ChatResponse>

Inherited from

OpenAI.chat

Defined in

packages/core/src/llm/LLM.ts:212


complete

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

Parameters

NameType
paramsLLMCompletionParamsStreaming

Returns

Promise<AsyncIterable<CompletionResponse>>

Inherited from

OpenAI.complete

Defined in

packages/core/src/llm/base.ts:17

complete(params): Promise<CompletionResponse>

Parameters

NameType
paramsLLMCompletionParamsNonStreaming

Returns

Promise<CompletionResponse>

Inherited from

OpenAI.complete

Defined in

packages/core/src/llm/base.ts:20


mapMessageType

mapMessageType(messageType): "function" | "user" | "assistant" | "system" | "tool"

Parameters

NameType
messageTypeMessageType

Returns

"function" | "user" | "assistant" | "system" | "tool"

Inherited from

OpenAI.mapMessageType

Defined in

packages/core/src/llm/LLM.ts:173


streamChat

streamChat(«destructured»): AsyncIterable<ChatResponseChunk>

Parameters

NameType
«destructured»LLMChatParamsStreaming

Returns

AsyncIterable<ChatResponseChunk>

Inherited from

OpenAI.streamChat

Defined in

packages/core/src/llm/LLM.ts:259


toOpenAIMessage

toOpenAIMessage(messages): { content: any = message.content; role: "function" | "user" | "assistant" | "system" | "tool" }[]

Parameters

NameType
messagesChatMessage[]

Returns

{ content: any = message.content; role: "function" | "user" | "assistant" | "system" | "tool" }[]

Inherited from

OpenAI.toOpenAIMessage

Defined in

packages/core/src/llm/LLM.ts:192