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: What about adding support for Groq, Antropic, Google AI, and more with simple curl? #1461

Open
1 task done
zinwelzl opened this issue Nov 11, 2024 · 1 comment
Open
1 task done

Comments

@zinwelzl
Copy link

Is there an existing feature or issue for this?

  • I have searched the existing issues

Expected feature

What about adding support for Groq, Antropic, Google AI, and more with simple curl?

Here are some simple curl commands to connect to the APIs of OpenAI, Groq, Anthropic, and Google AI:

Example Usage (General Structure):

curl -X POST <API_URL>
-H "Authorization: Bearer YOUR_API_KEY"
-H "Content-Type: application/json"
-d '{"<data_structure_here>"}'

OpenAI

curl -X POST "https://api.openai.com/v1/engines/davinci-codex/completions" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer YOUR_OPENAI_API_KEY" \
     -d '{
           "prompt": "Translate the following text to French: 'Hello, world!'",
           "max_tokens": 60
         }'

Groq

curl -X POST "https://api.groq.com/openai/v1/chat/completions" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer YOUR_GROQ_API_KEY" \
     -d '{
           "model": "groq-model",
           "messages": [
             {"role": "system", "content": "You are a helpful AI assistant."},
             {"role": "user", "content": "Tell me a joke."}
           ],
           "response_format": {"type": "json_schema", "json_schema": {"name": "joke_response", "schema": {"type": "object", "properties": {"joke": {"type": "string"}}, "required": ["joke"]}}},
           "temperature": 0.7,
           "max_tokens": 50,
           "stream": false
         }'

Anthropic

curl -X POST "https://api.anthropic.com/v1/chat/completions" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer YOUR_ANTHROPI_API_KEY" \
     -d '{
           "prompt": "What is the capital of France?",
           "max_tokens": 60
         }'

Google AI

curl -X POST "https://ai.googleapis.com/v1/projects/YOUR_PROJECT_ID/models/YOUR_MODEL_ID/versions/YOUR_VERSION_ID:predict" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer YOUR_GOOGLE_AI_API_KEY" \
     -d '{
           "instances": [
             {"input": {"text": "Translate the following text to French: 'Hello, world!'"}}
           ]
         }'

Alternative solutions

No response

Anything else?

No response

Copy link
Contributor

Hey @zinwelzl! 🚀 Thanks for this exciting feature idea!

We love seeing fresh concepts that could take reNgine to the next level. 🌟

To help us understand your vision better, could you:

📝 Provide a detailed description of the feature
🎯 Explain the problem it solves or the value it adds
💡 Share any implementation ideas you might have

Your input is invaluable in shaping the future of reNgine. Let's innovate together! 💪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant