mirror of
https://github.com/dartdavros/chatballs.git
synced 2026-10-14 13:19:01 +03:00
a0d2d6195483fdeff47e1bad3eebdd53e6c8dca6
OpenRouter, the generic Custom adapter and (in track B) CustoAI all speak the same Chat Completions shape: POST /chat/completions, POST /embeddings, Authorization: Bearer <key>, response with choices[0].message.content and usage. The transport and response parsing were duplicated in OpenRouterProvider and would be duplicated again by CustoAI. Move post_json / get_json / chat_completions / embeddings into a new ai/provider/openai_http.py module that owns the HTTP transport and OpenAI-shape parsing. Adapters keep their product semantics only: - OpenRouterProvider delegates chat (with usage.include=true to read usage.cost) and embed to openai_http; it is now a thin adapter, not a transport owner. - CustomProvider inherits the delegation unchanged. Update OpenRouterProviderProxyTests to mock openai_http.build_opener (the new transport location) and add the model field to the fake response so the parsed ChatResult matches. Verified: 13/13 integrations tests, 47/47 ai tests.
CustoCRM
Canonical implementation workspace for hub.edevs.tech.
Local start
Copy-Item .env.example .env
.\scripts\start.ps1
The local compose stack contains:
- isolated app, platform, and loopback-only admin Django runtimes;
- background worker;
- PostgreSQL;
- Redis;
- Internal Hub UI;
- Web Chat UI;
- local Nginx reverse proxy.
No production secrets are stored in the repository.
Default local URLs:
- App gateway:
http://app.localhost/ - Platform health:
http://platform.localhost/api/v1/health/live/ - Django admin (loopback only):
http://127.0.0.1:18001/admin/ - Internal Hub UI (direct Vite):
http://localhost:5173 - Web Chat:
http://localhost:5175 - App API (direct):
http://localhost:8010/api/v1
Local accounts (TOTP disabled). These credentials are fixed — do not change them:
- OWNER —
owner@edevs.tech/Owner-Local-2026 - OPERATOR —
a.kotova@edevs.tech/Operator-Local-2026
Bootstrap the organization and both accounts:
docker compose run --rm backend-app python manage.py bootstrap_owner --email owner@edevs.tech --password Owner-Local-2026 --name "Иван Петров"
Tests
All suites run in Docker, so no manual environment is required — the test runners auto-detect themselves and relax production hardening (secret-key fail-fast, SSL redirect, throttling) for the duration of the run.
Run everything (backend tests, frontend unit tests, typechecks):
.\scripts\check.ps1
Individual suites:
# Backend (pytest + pytest-django)
docker compose run --rm backend-app pytest
# Frontend unit tests (vitest)
docker compose run --rm frontend npm run test
# End-to-end (Playwright, internal-ui) — auto-starts the dev server
npx playwright install chromium # one-time
npx playwright test --project=internal-ui
Backend pytest configuration lives in apps/backend/pytest.ini (it must sit
next to manage.py so it is also visible inside the backend container).
Description
No description provided
aiai-agentcustomer-servicecustomer-supportdjangodocker-composehelpdeskknowledge-baselive-chatmaxopen-sourcepgvectorragself-hostedtelegramtelegrambot
Readme
AGPL-3.0
12 MiB
0 Stars
1 Watchers
0 Forks
Languages
Python
42.1%
TypeScript
25.1%
HTML
15.6%
JavaScript
10.6%
CSS
5.8%
Other
0.7%