mirror of https://github.com/aliasrobotics/cai.git
v0.5.7, fix in guardrails
Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>
This commit is contained in:
parent
756c0917d8
commit
900c52c494
|
|
@ -1,6 +1,6 @@
|
||||||
[project]
|
[project]
|
||||||
name = "cai-framework"
|
name = "cai-framework"
|
||||||
version = "0.5.6"
|
version = "0.5.7"
|
||||||
description = "Cybersecurity AI Framework"
|
description = "Cybersecurity AI Framework"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.9"
|
requires-python = ">=3.9"
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,9 @@ from openai import AsyncOpenAI
|
||||||
import os
|
import os
|
||||||
import unicodedata
|
import unicodedata
|
||||||
|
|
||||||
|
# Determine API key
|
||||||
|
api_key = os.getenv("ALIAS_API_KEY", os.getenv("OPENAI_API_KEY", "sk-alias-1234567890"))
|
||||||
|
|
||||||
|
|
||||||
class PromptInjectionCheck(BaseModel):
|
class PromptInjectionCheck(BaseModel):
|
||||||
"""Result of prompt injection detection"""
|
"""Result of prompt injection detection"""
|
||||||
|
|
@ -221,7 +224,7 @@ injection_detector_agent = Agent(
|
||||||
output_type=PromptInjectionCheck,
|
output_type=PromptInjectionCheck,
|
||||||
model=OpenAIChatCompletionsModel(
|
model=OpenAIChatCompletionsModel(
|
||||||
model=os.getenv('CAI_MODEL', 'alias0'),
|
model=os.getenv('CAI_MODEL', 'alias0'),
|
||||||
openai_client=AsyncOpenAI(),
|
openai_client=AsyncOpenAI(api_key=api_key),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue