From 91bf10c3105be2402336cd3cc21a5b4be02603c6 Mon Sep 17 00:00:00 2001 From: Alexander Myasoedov Date: Mon, 30 Dec 2024 14:39:27 +0200 Subject: [PATCH] feat(Add more providers): --- agentic_security/http_spec.py | 3 +- agentic_security/static/base.js | 69 +++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 1 deletion(-) diff --git a/agentic_security/http_spec.py b/agentic_security/http_spec.py index 95eab50..d8e6f9e 100644 --- a/agentic_security/http_spec.py +++ b/agentic_security/http_spec.py @@ -18,7 +18,8 @@ def encode_audio_base64_by_url(url: str) -> str: return "data:audio/mpeg;base64," + encoded_content -class InvalidHTTPSpecError(Exception): ... +class InvalidHTTPSpecError(Exception): + ... class LLMSpec(BaseModel): diff --git a/agentic_security/static/base.js b/agentic_security/static/base.js index 8cdfd01..b255ff7 100644 --- a/agentic_security/static/base.js +++ b/agentic_security/static/base.js @@ -96,6 +96,69 @@ Content-Type: multipart/form-data "model": "whisper-large-v3" } `, + `POST https://api.gemini.com/v1/generate +Authorization: Bearer $GEMINI_API_KEY +Content-Type: application/json + +{ + "model": "gemini-latest", + "prompt": "<>", + "temperature": 0.8, + "max_tokens": 150, + "top_p": 1.0, + "frequency_penalty": 0, + "presence_penalty": 0 +} +`, + `POST https://api.anthropic.com/v1/complete +Authorization: Bearer $ANTHROPIC_API_KEY +Content-Type: application/json + +{ + "model": "claude-v1.3", + "prompt": "<>", + "temperature": 0.7, + "max_tokens_to_sample": 256, + "stop_sequences": ["\n\nHuman:"] +} +`, + `POST https://api.cohere.ai/generate +Authorization: Bearer $COHERE_API_KEY +Content-Type: application/json + +{ + "model": "command-xlarge-nightly", + "prompt": "<>", + "max_tokens": 300, + "temperature": 0.75, + "k": 0, + "p": 0.75 +} +`, + + `POST https://<>.openai.azure.com/openai/deployments/<>/completions?api-version=2023-06-01-preview +Authorization: Bearer $AZURE_API_KEY +Content-Type: application/json + +{ + "prompt": "<>", + "max_tokens": 150, + "temperature": 0.7, + "top_p": 0.9, + "frequency_penalty": 0, + "presence_penalty": 0 +} +`, + + `POST https://api.assemblyai.com/v2/transcript +Authorization: Bearer $ASSEMBLY_API_KEY +Content-Type: application/json + +{ + "audio_url": "<>" +} +`, + ] @@ -107,6 +170,12 @@ let LLM_CONFIGS = [ { name: 'Together.ai', prompts: 40000 }, { name: 'Custom API Image', prompts: 40000, customInstructions: 'Requires api spec' }, { name: 'Custom API Files', prompts: 40000, customInstructions: 'Requires api spec' }, + { name: 'Gemini', prompts: 40000 }, + { name: 'Claude', prompts: 40000 }, + { name: 'Cohere', prompts: 40000 }, + { name: 'Azure OpenAI', prompts: 40000 }, + { name: 'assemblyai', prompts: 40000 }, + ]