-
Notifications
You must be signed in to change notification settings - Fork 34
core(clean): clean code base dto/dc/naming and little improvement #220
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
Changes from all commits
af7704e
9787f94
e7a5346
c180cce
7262c7b
9556501
809e8cd
f3bc3ab
1abdc99
baa3aec
8cb85ba
6bec715
aad3d9e
1f86760
357233a
5cd8e1d
2e8dd58
1663cf3
57eda27
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,51 +1,34 @@ | ||
| # --- Starknet configuration (mandatory) --- | ||
| STARKNET_PUBLIC_ADDRESS="YOUR_STARKNET_PUBLIC_ADDRESS" | ||
| STARKNET_PRIVATE_KEY="YOUR_STARKNET_PRIVATE_KEY" | ||
| STARKNET_RPC_URL="YOUR_STARKNET_RPC_URL" | ||
|
|
||
| # --- AI Model API Keys (mandatory) --- | ||
| # Add the API keys for the specific AI providers you use in config/models/default.models.json | ||
| # The agent will automatically load the correct key based on the provider name. | ||
|
|
||
| # Example for OpenAI: | ||
| OPENAI_API_KEY="YOUR_OPENAI_API_KEY" # (e.g., sk-...) | ||
|
|
||
| # Example for Anthropic: | ||
| ANTHROPIC_API_KEY="YOUR_ANTHROPIC_API_KEY" # (e.g., sk-ant-...) | ||
|
|
||
| # Example for Google Gemini: | ||
| GEMINI_API_KEY="YOUR_GEMINI_API_KEY" | ||
|
|
||
| # Example for DeepSeek: | ||
| DEEPSEEK_API_KEY="YOUR_DEEPSEEK_API_KEY" | ||
|
|
||
| # Note: You do not need an API key if using a local Ollama model. | ||
|
|
||
| # --- General Agent Configuration (mandatory) --- | ||
| SERVER_API_KEY="YOUR_SERVER_API_KEY" # A secret key for your agent server API | ||
| SERVER_PORT="3001" | ||
| SERVER_API_KEY="YOUR_SERVER_API_KEY" | ||
| SERVER_PORT="3002" | ||
|
|
||
| # --- PostgreSQL Database Configuration (mandatory) --- | ||
| POSTGRES_USER=admin | ||
| POSTGRES_HOST=localhost # dev | ||
| # POSTGRES_HOST=postgres # prod | ||
| POSTGRES_HOST=localhost | ||
| POSTGRES_DB=postgres | ||
| POSTGRES_PASSWORD=admin | ||
| POSTGRES_PORT=5432 | ||
|
|
||
| # --- LangSmith Tracing (Optional) --- | ||
| # Set LANGSMITH_TRACING=true to enable tracing | ||
| LANGSMITH_TRACING=false | ||
| LANGSMITH_ENDPOINT="https://api.smith.langchain.com" | ||
| LANGSMITH_API_KEY="YOUR_LANGSMITH_API_KEY" # (Only needed if LANGSMITH_TRACING=true) | ||
| LANGSMITH_PROJECT="Snak" # (Optional project name for LangSmith) | ||
| LANGSMITH_ENDPOINT="https://eu.api.smith.langchain.com/" | ||
| LANGSMITH_API_KEY="YOUR_LANGSMITH_API_KEY" | ||
| LANGSMITH_PROJECT="Snak" | ||
|
|
||
| # --- AI Model Configuration (mandatory) --- | ||
| GEMINI_API_KEY="YOUR_GEMINI_API_KEY" | ||
| SMITHERY_API_KEY="YOUR_SMITHERY_API_KEY" | ||
|
|
||
| # --- Redis Configuration (mandatory) --- | ||
| REDIS_HOST=localhost | ||
| REDIS_PORT=6379 | ||
| REDIS_PASSWORD="YOUR_REDIS_PASSWORD" | ||
| REDIS_DB=0 | ||
|
|
||
| DEFAULT_MODEL_PROVIDER="your_default_provider" # e.g., "openai", "anthropic", "gemini", "deepseek", "ollama" | ||
| DEFAULT_MODEL_NAME="your_default_model_name" # e.g., "gpt-4o", "claude-3", "gemini-1.5", "deepseek-v1", "llama2" | ||
| DEFAULT_TEMPERATURE="your_default_temperature" # e.g., "0.7" | ||
| DEFAULT_MAX_TOKENS="your_default_max_tokens" # e.g., "4096" | ||
| # --- Snak User ID (mandatory) --- | ||
| SNAK_USER_ID="YOUR_SNAK_USER_ID" | ||
|
|
||
| # --- Node Environment --- | ||
| NODE_ENV="development" # "development" or "production" | ||
| # --- Default Model Configuration (mandatory) --- | ||
| DEFAULT_MODEL_PROVIDER="gemini" | ||
| DEFAULT_MODEL_NAME="gemini-2.5-flash" | ||
| DEFAULT_TEMPERATURE=0.7 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -103,10 +103,8 @@ | |
| "max_execution_timeout_ms": 500000, | ||
| "max_token_usage": 200000, | ||
| "model": { | ||
| "provider_max_length": 100, | ||
| "provider_min_length": 3, | ||
| "model_name_max_length": 100, | ||
| "model_name_min_length": 3, | ||
| "allowed_provider": "gemini", | ||
| "allowed_models": ["gemini-2.5-flash", "gemini-2.5-pro"], | ||
| "max_temperature": 1, | ||
| "max_tokens": 8192 | ||
| } | ||
|
Comment on lines
105
to
110
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainVerify that schema and validation logic support the new allowlist structure. The validation strategy has been updated from length-based constraints to explicit allowlists (
Run the following script to verify the guards schema and validation logic: 🏁 Script executed: #!/bin/bash
# Check guards schema definition
ast-grep --pattern $'allowed_provider'
ast-grep --pattern $'allowed_models'
# Verify validation service enforcement
rg -nP --type=ts -C5 "allowed_provider|allowed_models" packages/core/src/Length of output: 2216 I need to gather more information about the validation enforcement logic and check for any existing agents that might not conform to the new allowlist. Let me run additional verification: [/run_scripts] 🏁 Script executed: #!/bin/bash
# See full validation implementation
cat packages/core/src/services/agent-validation.service.ts | sed -n '268,310p'
# Find where schema is applied (look for parse/safeParse of GuardsSchema or AgentGraphModelConfigSchema)
rg -nP --type=ts "parse|safeParse" packages/core/src/config/guards/ -A2 -B2
# Check if there are other model/provider configurations
rg -nP --type=json "model_provider|allowed_provider" config/Length of output: 2717 [/run_scripts] 🏁 Script executed: #!/bin/bash
# Search for other agent configurations with different providers
find config -name "*.json" -type f | xargs grep -l "model_provider\|agents" 2>/dev/null
# Check for any model_provider values other than gemini in config
rg -P "model_provider" config/ -B2 -A2
# Look for agent definitions in graph configs
rg -P "\"agents\"|\"graph\"" config/guards/ -B1 -A1Length of output: 408 [/run_scripts] 🏁 Script executed: #!/bin/bash
# Examine agent configuration files
echo "=== default.agent.json ==="
cat config/agents/default.agent.json | head -50
echo -e "\n=== supervisor.agent.json ==="
cat config/agents/supervisor.agent.json | head -50
# Look for model_provider in agent configs specifically
rg -P "model_provider" config/agents/ -B2 -A2Length of output: 4473 [/run_scripts] 🏁 Script executed: #!/bin/bash
# Find where validateModelConfig is called
rg -nP "validateModelConfig" packages/core/src/ -B3 -A3
# Check if agents are loaded and validated during startup
rg -nP "loadGuardsConfig|validateAgent|validateModelConfig" packages/core/src/ | head -30
# See if there's any migration logic or fallback for existing agents
rg -nP "migrate|fallback|default.*model|openai" config/agents/ -B2 -A2Length of output: 5219 Migrate all existing agents to use Gemini models before deployment. The guards schema and validation enforcement are correctly implemented, but all 7 existing agent configurations still use OpenAI ( Update the following agent files to use
🤖 Prompt for AI Agents |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SERVER_API_KEYis deprecated