feat: Add typed stuff
This commit is contained in:
@@ -268,7 +268,7 @@ export class GeminiProvider extends BaseAIProvider {
|
||||
* @returns Promise resolving to formatted completion response
|
||||
* @throws {Error} If API request fails
|
||||
*/
|
||||
protected async doComplete<T = any>(params: CompletionParams<T>): Promise<CompletionResponse> {
|
||||
protected async doComplete(params: CompletionParams): Promise<CompletionResponse<string>> {
|
||||
if (!this.client || !this.model) {
|
||||
throw new AIProviderError('Gemini client not initialized', AIErrorType.INVALID_REQUEST);
|
||||
}
|
||||
@@ -617,7 +617,7 @@ export class GeminiProvider extends BaseAIProvider {
|
||||
* @returns Formatted completion response
|
||||
* @throws {AIProviderError} If response format is unexpected
|
||||
*/
|
||||
private formatCompletionResponse(response: any, model: string): CompletionResponse {
|
||||
private formatCompletionResponse(response: any, model: string): CompletionResponse<string> {
|
||||
// Handle multiple text parts in the response
|
||||
const candidate = response.candidates?.[0];
|
||||
if (!candidate) {
|
||||
|
||||
Reference in New Issue
Block a user