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

[FEAT]: Add calls to GAI preferably [Gemini] for docs-bot #6

Open
thatbeautifuldream opened this issue Dec 23, 2023 · 3 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@thatbeautifuldream
Copy link
Owner

Description

The APIs are now generally available and have a generous free tier with upto 60 request per minute.

Quickstart to consuming the library

const { GoogleGenerativeAI } = require("@google/generative-ai");

// Access your API key as an environment variable (see "Set up your API key" above)
const genAI = new GoogleGenerativeAI(process.env.API_KEY);

async function run() {
  // For text-only input, use the gemini-pro model
  const model = genAI.getGenerativeModel({ model: "gemini-pro"});

  const prompt = "Write a story about a magic backpack."

  const result = await model.generateContent(prompt);
  const response = await result.response;
  const text = response.text();
  console.log(text);
}

run();

https://ai.google.dev/tutorials/node_quickstart

Additional Information

No response

@thatbeautifuldream thatbeautifuldream added the enhancement New feature or request label Dec 23, 2023
@thatbeautifuldream thatbeautifuldream self-assigned this Dec 27, 2023
@thatbeautifuldream
Copy link
Owner Author

@thatbeautifuldream
Copy link
Owner Author

[TODO] : add auth setup to whole app and rate limits for future.

@thatbeautifuldream
Copy link
Owner Author

Decided to offload the chat to vercel ai chat.

Fetch content from the app but a route parsing and cleaning MDX to a string for prompt feed.

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