- getGeminiAPI(config?): {
baseMessageToContent: ((message: BaseMessage, prevMessage: undefined | BaseMessage, useSystemInstruction: boolean) => Promise<GeminiContent[]>);
chunkToString: ((chunk: BaseMessageChunk) => string);
messageContentToParts: ((content: MessageContent) => Promise<GeminiPart[]>);
safeResponseToBaseMessage: ((response: GoogleLLMResponse, safetyHandler: GoogleAISafetyHandler) => BaseMessage);
safeResponseToChatGeneration: ((response: GoogleLLMResponse, safetyHandler: GoogleAISafetyHandler) => ChatGenerationChunk);
safeResponseToChatResult: ((response: GoogleLLMResponse, safetyHandler: GoogleAISafetyHandler) => ChatResult);
safeResponseToString: ((response: GoogleLLMResponse, safetyHandler: GoogleAISafetyHandler) => string);
} Returns {
baseMessageToContent: ((message: BaseMessage, prevMessage: undefined | BaseMessage, useSystemInstruction: boolean) => Promise<GeminiContent[]>);
chunkToString: ((chunk: BaseMessageChunk) => string);
messageContentToParts: ((content: MessageContent) => Promise<GeminiPart[]>);
safeResponseToBaseMessage: ((response: GoogleLLMResponse, safetyHandler: GoogleAISafetyHandler) => BaseMessage);
safeResponseToChatGeneration: ((response: GoogleLLMResponse, safetyHandler: GoogleAISafetyHandler) => ChatGenerationChunk);
safeResponseToChatResult: ((response: GoogleLLMResponse, safetyHandler: GoogleAISafetyHandler) => ChatResult);
safeResponseToString: ((response: GoogleLLMResponse, safetyHandler: GoogleAISafetyHandler) => string);
}
baseMessageToContent: ((message: BaseMessage, prevMessage: undefined | BaseMessage, useSystemInstruction: boolean) => Promise<GeminiContent[]>)
- (message, prevMessage, useSystemInstruction): Promise<GeminiContent[]>
Parameters
- message: BaseMessage
- prevMessage: undefined | BaseMessage
- useSystemInstruction: boolean
chunkToString: ((chunk: BaseMessageChunk) => string)
- (chunk): string
Returns string
messageContentToParts: ((content: MessageContent) => Promise<GeminiPart[]>)
- (response, safetyHandler): BaseMessage
Returns BaseMessage
safeResponseToChatGeneration: ((response: GoogleLLMResponse, safetyHandler: GoogleAISafetyHandler) => ChatGenerationChunk)
- (response, safetyHandler): ChatGenerationChunk
Returns ChatGenerationChunk
- (response, safetyHandler): ChatResult
Returns ChatResult
- (response, safetyHandler): string
Returns string