Implements the Gemini language model integration for Theia

Implements

  • LanguageModel

Constructors

Properties

apiKey: (() => undefined | string)

Type declaration

    • (): undefined | string
    • Returns undefined | string

enableStreaming: boolean
id: string
model: string
retrySettings: (() => GoogleLanguageModelRetrySettings)
tokenUsageService?: TokenUsageService

Methods

  • Parameters

    • genAI: GoogleGenAI
    • request: UserRequest
    • Optional cancellationToken: CancellationToken
    • Optional toolMessages: Content[]

    Returns Promise<LanguageModelStreamResponse>

  • Parameters

    • request: UserRequest
    • Optional cancellationToken: CancellationToken

    Returns Promise<LanguageModelResponse>

  • Implements a retry mechanism for the handle(non)Streaming request functions.

    Type Parameters

    • T

    Parameters

    • fn: (() => Promise<T>)

      the wrapped function to which the retry logic should be applied.

        • (): Promise<T>
        • Returns Promise<T>

    Returns Promise<T>

    the result of the wrapped function.