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

Request for adding Google Gemini(formerly known as Bard) #236

Closed
golam71 opened this issue Mar 2, 2024 · 7 comments
Closed

Request for adding Google Gemini(formerly known as Bard) #236

golam71 opened this issue Mar 2, 2024 · 7 comments

Comments

@golam71
Copy link

golam71 commented Mar 2, 2024

So you get api key from here

here is a small bash code i have written but i dont know C

#!/bin/bash

# Check if an argument is provided
if [ -z "$1" ]; then
	echo "Usage: $0 <prompt>"
	exit 1
fi

# URL encode the prompt
prompt=$(echo -n "$1" | jq -s -R -r @uri)

# Make the API request with the provided prompt
curl -sS -H 'Content-Type: application/json' \
	-d "{\"contents\":[{\"parts\":[{\"text\":\"$prompt\"}]}]}" \
	-X POST https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent?key=API_KEY_GOES_HERE |
	jq -r '.candidates[0].content.parts[0].text' | sed 's/\\n/\n/g'

It does not support C but the documentation is here and I would have liked to help sadly I am only a frontend dev .

Regards,
Golam Moula

@johnd0e
Copy link
Contributor

johnd0e commented Mar 2, 2024

@sinuso
Copy link

sinuso commented Mar 3, 2024

I think cookies or both options, cookies or api key, would be better.
There are too many countries, such as Spain, that cannot obtain an API key.

Only these regions can have access https://ai.google.dev/available_regions#available_regions

@johnd0e
Copy link
Contributor

johnd0e commented Mar 3, 2024

@sinuso
You can avoid geo restrictions using openai-gemini project.

@xpufx
Copy link

xpufx commented Mar 4, 2024

@sinuso You can avoid geo restrictions using openai-gemini project.

As far as I can tell this is not only for escaping geo restrictions but also an openAI compatible API proxy. Where would the proxy URL (in place of openai base url) and gemini API key go in tgpt though?

@johnd0e
Copy link
Contributor

johnd0e commented Mar 4, 2024

@xpufx

Where would the proxy URL (in place of openai base url) and gemini API key go in tgpt though?

Seems that is not implemented in tgpt yet.

@xpufx
Copy link

xpufx commented Mar 5, 2024

Come to think of it. openai-gemini is not very convenient with this requirement that the clients all have to pass the gemini key. If you were writing your own tool, sure.

@aandrew-me
Copy link
Owner

I cannot properly test it because my country isn't supported by Gemini...

@aandrew-me aandrew-me closed this as not planned Won't fix, can't repro, duplicate, stale Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants