Security-Tools-Alliance / rengine-ng

reNgine-ng is an automated reconnaissance framework for web applications with a focus on highly configurable streamlined recon process via Engines, recon data correlation and organization, continuous monitoring, backed by a database, and simple yet intuitive User Interface.
GNU General Public License v3.0
68 stars 11 forks source link

feat(scope): What about adding support for Groq, Antropic, Google AI, and more with simple curl? #234

Closed zinwelzl closed 2 weeks ago

zinwelzl commented 2 weeks ago

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 \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{""}'

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

Acknowledgements

psyray commented 2 weeks ago

I've refactored the LLM part in this PR #233 You can also test this PR #229 Feel free to test both Best is to create a branch and merge those 2 inside by order, 229 then 233

When those 2 will be merged I will implement those ones Should be released in 2.2.0

And it's not as simple as a cURL :roll_eyes: