harnessed_agent/models/harnessed_agent_config.json
yumoqing 4e65ff8fe4 refactor: LLM client for calling supplier LLM APIs (not server)
Replaces wrong-direction llm_api.py (which served OpenAI endpoints)
with llm_client.py -- a client that calls supplier LLM APIs.

New module: llm_client.py
  - llm_chat(messages, model, temperature, ...) -> OpenAI response dict
  - llm_chat_stream(messages, ...) -> async generator of SSE chunks
  - llm_simple(prompt, system) -> plain text response
  - llm_list_models() -> list available models from provider
  - llm_get_config() -> show current config (key masked)
  - Supports provider presets: openai, dashscope, deepseek, siliconflow
  - Retry with exponential backoff (3 attempts)
  - 429 rate limit handling with Retry-After
  - Structured logging via appPublic.log

Model changes (harnessed_agent_config):
  - Add llm_provider (preset name: dashscope/openai/deepseek/siliconflow)
  - Add top_p field
  - llm_service_url defaults to DashScope compatible endpoint

Other:
  - Remove wrong-direction /v1/ endpoints
  - Fix pyproject.toml deps: only sqlor + bricks_for_python
  - Update init/data.json seed data with LLM config fields
  - Update CRUD view with llm_provider dropdown
2026-05-07 11:57:04 +08:00

173 lines
5.0 KiB
JSON

{
"summary": [
{
"name": "harnessed_agent_config",
"title": "Hermes Agent module configuration settings",
"primary": "id"
}
],
"fields": [
{
"name": "id",
"title": "Unique configuration identifier",
"type": "str",
"length": 32,
"nullable": "no"
},
{
"name": "user_id",
"title": "User ID for multi-user isolation",
"type": "str",
"length": 32,
"nullable": "no"
},
{
"name": "work_dir",
"title": "Working directory path",
"type": "str",
"length": 255,
"nullable": "no",
"default": "./hermes_work"
},
{
"name": "skills_path",
"title": "Skills directory path",
"type": "str",
"length": 255,
"nullable": "no",
"default": "~/.hermes/skills"
},
{
"name": "max_memory_tokens",
"title": "Maximum tokens for memory context",
"type": "int",
"nullable": "no",
"default": "2000"
},
{
"name": "default_priority",
"title": "Default priority for new memories (0-100)",
"type": "int",
"nullable": "no",
"default": "50"
},
{
"name": "high_priority_threshold",
"title": "Threshold for high priority memories",
"type": "int",
"nullable": "no",
"default": "70"
},
{
"name": "low_priority_threshold",
"title": "Threshold for low priority memories",
"type": "int",
"nullable": "no",
"default": "30"
},
{
"name": "auto_cleanup_enabled",
"title": "Enable automatic memory cleanup",
"type": "str",
"length": "1",
"nullable": "no",
"default": "1"
},
{
"name": "min_retention_days",
"title": "Minimum days to retain memories",
"type": "int",
"nullable": "no",
"default": "30"
},
{
"name": "default_model",
"title": "Default LLM model for agent tasks",
"type": "str",
"length": 64,
"nullable": "yes",
"default": "qwen3-max"
},
{
"name": "default_temperature",
"title": "Default temperature for LLM calls",
"type": "float",
"length": 5,
"dec": 2,
"nullable": "no",
"default": "0.7"
},
{
"name": "top_p",
"title": "Default top_p for LLM calls",
"type": "float",
"length": 5,
"dec": 2,
"nullable": "no",
"default": "1.00"
},
{
"name": "enable_streaming",
"title": "Enable streaming response for LLM calls",
"type": "str",
"length": "1",
"nullable": "no",
"default": "1"
},
{
"name": "llm_provider",
"title": "LLM provider preset name",
"type": "str",
"length": 32,
"nullable": "yes",
"default": "dashscope",
"comments": "Provider preset: openai, dashscope, deepseek, siliconflow, or custom (empty)"
},
{
"name": "llm_service_url",
"title": "LLM service base URL (OpenAI-compatible endpoint)",
"type": "str",
"length": 255,
"nullable": "yes",
"default": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"comments": "Base URL for the LLM provider API, e.g. https://api.openai.com/v1"
},
{
"name": "llm_api_key",
"title": "LLM service API key",
"type": "str",
"length": 255,
"nullable": "yes",
"default": "",
"comments": "API key for LLM service authentication (Bearer token)"
},
{
"name": "available_models",
"title": "Available LLM models (JSON array)",
"type": "text",
"nullable": "yes",
"default": "",
"comments": "JSON array of model IDs, e.g. [\"qwen3-max\", \"qwen3-plus\"]"
},
{
"name": "created_at",
"title": "Creation timestamp",
"type": "timestamp",
"nullable": "no"
},
{
"name": "updated_at",
"title": "Last update timestamp",
"type": "timestamp",
"nullable": "no"
}
],
"indexes": [
{
"name": "idx_user_agent_config",
"idxtype": "index",
"idxfields": ["user_id"]
}
],
"codes": []
}