Skip to main content

Class: GeminiSession

Gemini Session to manage the connection to the Gemini API

Implements

  • IGeminiSession

Constructors

new GeminiSession()

new GeminiSession(options): GeminiSession

Parameters

options: GoogleGeminiSessionOptions

Returns

GeminiSession

Defined in

packages/llamaindex/src/llm/gemini/base.ts:80

Methods

getChatStream()

getChatStream(result): GeminiChatStreamResponse

Parameters

result: GenerateContentStreamResult

Returns

GeminiChatStreamResponse

Implementation of

IGeminiSession.getChatStream

Defined in

packages/llamaindex/src/llm/gemini/base.ts:114


getCompletionStream()

getCompletionStream(result): AsyncIterable<CompletionResponse>

Parameters

result: GenerateContentStreamResult

Returns

AsyncIterable<CompletionResponse>

Implementation of

IGeminiSession.getCompletionStream

Defined in

packages/llamaindex/src/llm/gemini/base.ts:130


getGenerativeModel()

getGenerativeModel(metadata): GenerativeModel

Parameters

metadata: ModelParams

Returns

GenerativeModel

Implementation of

IGeminiSession.getGenerativeModel

Defined in

packages/llamaindex/src/llm/gemini/base.ts:90


getResponseText()

getResponseText(response): string

Parameters

response: EnhancedGenerateContentResponse

Returns

string

Implementation of

IGeminiSession.getResponseText

Defined in

packages/llamaindex/src/llm/gemini/base.ts:97


getToolsFromResponse()

getToolsFromResponse(response): undefined | ToolCall[]

Parameters

response: EnhancedGenerateContentResponse

Returns

undefined | ToolCall[]

Implementation of

IGeminiSession.getToolsFromResponse

Defined in

packages/llamaindex/src/llm/gemini/base.ts:101