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
Source
packages/llamaindex/src/llm/gemini/base.ts:79
Properties
gemini
private
gemini:GoogleGenerativeAI
Source
packages/llamaindex/src/llm/gemini/base.ts:77
Methods
getChatStream()
getChatStream(
result
):GeminiChatStreamResponse
Parameters
• result: GenerateContentStreamResult
Returns
GeminiChatStreamResponse
Implementation of
IGeminiSession.getChatStream
Source
packages/llamaindex/src/llm/gemini/base.ts:110
getCompletionStream()
getCompletionStream(
result
):AsyncIterable
<CompletionResponse
>
Parameters
• result: GenerateContentStreamResult
Returns
AsyncIterable
<CompletionResponse
>
Implementation of
IGeminiSession.getCompletionStream
Source
packages/llamaindex/src/llm/gemini/base.ts:126
getGenerativeModel()
getGenerativeModel(
metadata
):GenerativeModel
Parameters
• metadata: ModelParams
Returns
GenerativeModel
Implementation of
IGeminiSession.getGenerativeModel
Source
packages/llamaindex/src/llm/gemini/base.ts:89
getResponseText()
getResponseText(
response
):string
Parameters
• response: EnhancedGenerateContentResponse
Returns
string
Implementation of
IGeminiSession.getResponseText
Source
packages/llamaindex/src/llm/gemini/base.ts:93
getToolsFromResponse()
getToolsFromResponse(
response
):undefined
|ToolCall
[]
Parameters
• response: EnhancedGenerateContentResponse
Returns
undefined
| ToolCall
[]
Implementation of
IGeminiSession.getToolsFromResponse