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:71
Properties
gemini
private
gemini:GoogleGenerativeAI
Source
packages/llamaindex/src/llm/gemini/base.ts:69
Methods
getChatStream()
getChatStream(
result
):GeminiChatStreamResponse
Parameters
• result: GenerateContentStreamResult
Returns
GeminiChatStreamResponse
Implementation of
IGeminiSession.getChatStream
Source
packages/llamaindex/src/llm/gemini/base.ts:89
getCompletionStream()
getCompletionStream(
result
):AsyncIterable
<CompletionResponse
>
Parameters
• result: GenerateContentStreamResult
Returns
AsyncIterable
<CompletionResponse
>
Implementation of
IGeminiSession.getCompletionStream
Source
packages/llamaindex/src/llm/gemini/base.ts:98
getGenerativeModel()
getGenerativeModel(
metadata
):GenerativeModel
Parameters
• metadata: ModelParams
Returns
GenerativeModel
Implementation of
IGeminiSession.getGenerativeModel
Source
packages/llamaindex/src/llm/gemini/base.ts:81
getResponseText()
getResponseText(
response
):string
Parameters
• response: EnhancedGenerateContentResponse
Returns
string
Implementation of
IGeminiSession.getResponseText