Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

give the ability to the user to select a custom api instead of only relying on gemini pro api #2

Open
mlnomadpy opened this issue Jan 2, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@mlnomadpy
Copy link
Owner

just change this function in popup.js, and make sure to wrap it in another function that help you choose the correct API to use (langchain, firebase, huggingface...)

async function getSummaryFromGeminiPro(content, apiKey, prefix) {
    const genAI = new GoogleGenerativeAI(apiKey);
    const model = genAI.getGenerativeModel({ model: "gemini-pro" });
    
    const fullContent = prefix + content;
    
    try {
        const result = await model.generateContent(fullContent);
        const response = await result.response;
        return await response.text();
    } catch (error) {
        console.error('Error generating processing:', error);
        throw new Error('Processing failed');
    }
}
@mlnomadpy mlnomadpy added the enhancement New feature or request label Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant