mirror of
https://github.com/msoedov/agentic_security.git
synced 2026-09-30 19:59:34 +02:00
feat(add deepseek api spec):
This commit is contained in:
1 parent
7cb321ce46
commit
b40d845e3c
2 files changed
+61
-1
No files matched your search
@@ -1,5 +1,6 @@
|
|||||||
import base64
|
import base64
|
||||||
import random
|
import random
|
||||||
|
import string
|
||||||
|
|
||||||
|
|
||||||
def rot13(input_text):
|
def rot13(input_text):
|
||||||
@@ -98,3 +99,47 @@ def zigzag_obfuscation(text):
|
|||||||
else:
|
else:
|
||||||
new_text += char
|
new_text += char
|
||||||
return new_text
|
return new_text
|
||||||
|
|
||||||
|
|
||||||
|
def caesar_cipher(text, shift=3):
|
||||||
|
"""Encrypts text using Caesar cipher with specified shift."""
|
||||||
|
result = []
|
||||||
|
for char in text:
|
||||||
|
if char.isupper():
|
||||||
|
result.append(chr((ord(char) + shift - 65) % 26 + 65))
|
||||||
|
elif char.islower():
|
||||||
|
result.append(chr((ord(char) + shift - 97) % 26 + 97))
|
||||||
|
else:
|
||||||
|
result.append(char)
|
||||||
|
return "".join(result)
|
||||||
|
|
||||||
|
|
||||||
|
def substitution_cipher(text, key=None):
|
||||||
|
"""Encrypts text using a substitution cipher with optional key."""
|
||||||
|
if key is None:
|
||||||
|
key = list(string.ascii_lowercase)
|
||||||
|
random.shuffle(key)
|
||||||
|
key = "".join(key)
|
||||||
|
|
||||||
|
# Create translation table
|
||||||
|
alphabet = string.ascii_lowercase
|
||||||
|
translation = str.maketrans(alphabet, key)
|
||||||
|
|
||||||
|
# Apply translation
|
||||||
|
return text.lower().translate(translation)
|
||||||
|
|
||||||
|
|
||||||
|
def vigenere_cipher(text, key):
|
||||||
|
"""Encrypts text using Vigenère cipher with provided key."""
|
||||||
|
result = []
|
||||||
|
key_length = len(key)
|
||||||
|
key_as_int = [ord(i) for i in key.lower()]
|
||||||
|
text = text.lower()
|
||||||
|
|
||||||
|
for i, char in enumerate(text):
|
||||||
|
if char.isalpha():
|
||||||
|
shift = key_as_int[i % key_length] - 97
|
||||||
|
result.append(chr((ord(char) + shift - 97) % 26 + 97))
|
||||||
|
else:
|
||||||
|
result.append(char)
|
||||||
|
return "".join(result)
|
||||||
@@ -17,7 +17,7 @@ Content-Type: application/json
|
|||||||
|
|
||||||
`,
|
`,
|
||||||
`POST https://api.openai.com/v1/chat/completions
|
`POST https://api.openai.com/v1/chat/completions
|
||||||
Authorization: Bearer sk-xxxxxxxxx
|
Authorization: Bearer $OPENAI_API_KEY
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -25,6 +25,20 @@ Content-Type: application/json
|
|||||||
"messages": [{"role": "user", "content": "<<PROMPT>>"}],
|
"messages": [{"role": "user", "content": "<<PROMPT>>"}],
|
||||||
"temperature": 0.7
|
"temperature": 0.7
|
||||||
}
|
}
|
||||||
|
`,
|
||||||
|
`
|
||||||
|
POST https://api.deepseek.com/chat/completions
|
||||||
|
Authorization: Bearer $DEEPSEEK_API_KEY
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"model": "deepseek-chat",
|
||||||
|
"messages": [
|
||||||
|
{"role": "system", "content": "You are a helpful assistant."},
|
||||||
|
{"role": "user", "content": "<<PROMPT>>"}
|
||||||
|
],
|
||||||
|
"stream": false
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
`POST https://api.replicate.com/v1/models/mistralai/mixtral-8x7b-instruct-v0.1/predictions
|
`POST https://api.replicate.com/v1/models/mistralai/mixtral-8x7b-instruct-v0.1/predictions
|
||||||
Authorization: Bearer $APIKEY
|
Authorization: Bearer $APIKEY
|
||||||
@@ -165,6 +179,7 @@ Content-Type: application/json
|
|||||||
let LLM_CONFIGS = [
|
let LLM_CONFIGS = [
|
||||||
{ name: 'Custom API', prompts: 40000, customInstructions: 'Requires api spec' },
|
{ name: 'Custom API', prompts: 40000, customInstructions: 'Requires api spec' },
|
||||||
{ name: 'Open AI', prompts: 24000 },
|
{ name: 'Open AI', prompts: 24000 },
|
||||||
|
{ name: 'Deepseek v1', prompts: 24000 },
|
||||||
{ name: 'Replicate', prompts: 40000 },
|
{ name: 'Replicate', prompts: 40000 },
|
||||||
{ name: 'Groq', prompts: 40000 },
|
{ name: 'Groq', prompts: 40000 },
|
||||||
{ name: 'Together.ai', prompts: 40000 },
|
{ name: 'Together.ai', prompts: 40000 },
|
||||||
|
|||||||
Reference in new issue
Block a user