10 Commits

Author SHA1 Message Date
d22dfdf383 fix: correct agent config form URLs and add config management menu item
- Fix agent_config_form.ui data_url and submit_url paths
  (wwwroot/ to wwwroot/api/ needs 'api/', not '../api/')
- Add '配置管理' menu entry to menu.ui pointing to harnessed_agent_config_view CRUD
2026-05-07 13:50:12 +08:00
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
608413a5d5 feat: implement OpenAI-compatible LLM API
- Add /v1/chat/completions endpoint (POST) with streaming support
- Add /v1/models endpoint (GET) listing available models
- Add /v1/completions endpoint (POST) legacy compatibility
- Add llm_api.py module with OpenAI API proxy via aiohttp
- Add llm_service_url, llm_api_key, available_models to config model
- Update harnessed_agent_config_view CRUD to protect API key field
- Register new functions in init.py (harnessed_llm_chat_completions etc.)
- Add .gitignore for pycache files

Endpoints available under module path:
  POST /harnessed_agent/v1/chat/completions
  GET  /harnessed_agent/v1/models
  POST /harnessed_agent/v1/completions
2026-05-07 11:36:35 +08:00
3e33bc0924 添加代理执行和模型配置:创建代理执行控制台UI和API,扩展config模型添加default_model/default_temperature/enable_streaming字段 2026-05-06 15:05:57 +08:00
ee4b416b50 修复菜单URL与CRUD alias不匹配:menu.ui使用正确的alias路径,.ui文件引用修正为JSON定义的alias 2026-05-06 14:25:27 +08:00
790a4f0e50 补全CRUD配置和API:为12个JSON添加editable段,创建36个.dspy API文件,修复.ui文件中entire_url引号 2026-05-06 14:05:16 +08:00
b27a089916 feat: add menu.ui with data table and feature menu items 2026-05-05 21:56:01 +08:00
ca16edf609 feat: add models, CRUD UI, config functions and config model definitions
- Add hermes_executions, hermes_tasks, hermes_workflows, task_dependencies models
- Add harnessed_agent_config model and view CRUD JSON
- Add config_functions.py for agent configuration
- Add agent_config.ui and ios_design.css frontend files
2026-05-04 11:56:37 +08:00
434ac73465 add design style 2026-05-04 10:09:04 +08:00
2f189c9291 bugfix 2026-04-16 15:40:17 +08:00