lambda-erp 1.4.25__tar.gz → 1.4.26__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/PKG-INFO +4 -4
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/README.md +3 -3
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/chat.py +17 -14
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/providers.py +18 -3
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/pyproject.toml +1 -1
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/.gitignore +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/LICENSE +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/__init__.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/attachments.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/auth.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/bootstrap.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/chat_links.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/demo_limits.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/deps.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/erp_context.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/errors.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/list_values.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/llm_provider.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/main.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/mcp_oauth.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/mentions.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/menu_layout.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/oauth.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/pdf.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/pdf_contract.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/pdf_exports.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/pdf_fonts.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/pdf_pages.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/pdf_profiles.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/pdf_templates.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/pricing_actions.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/record_attachments.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/record_notes.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/remarks_md.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/routers/__init__.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/routers/accounting.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/routers/actions.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/routers/admin.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/routers/analytics.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/routers/availability.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/routers/bank_reconciliation.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/routers/bank_statements.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/routers/chat_api.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/routers/documents.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/routers/masters.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/routers/mcp.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/routers/pdf_templates.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/routers/proposals.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/routers/reports.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/routers/setup.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/services.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/stock_actions.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/templates/_proposal_totals.html +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/templates/_record_base.html +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/templates/delivery_note.html +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/templates/document.html +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/templates/proposal.html +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/templates/record.html +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/templates/reservation.html +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/time_filters.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/tool_permissions.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/tool_results.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/api/write_context.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/docs/agents/README.md +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/frontend/LICENSE +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/frontend/README.md +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/frontend/src/api/client.ts +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/__init__.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/__init__.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/bank_account.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/bank_reconciliation.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/bank_statement_import.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/bank_transaction.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/budget.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/camt.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/chart_of_accounts.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/general_ledger.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/journal_entry.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/payment_entry.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/pos_invoice.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/purchase_invoice.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/revaluation.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/sales_invoice.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/settlement.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/setup/__init__.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/setup/engine.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/setup/pack.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/setup/packs/__init__.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/setup/packs/ch.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/setup/packs/de_common.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/setup/packs/de_skr03.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/setup/packs/de_skr04.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/setup/packs/generic.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/setup/profiles.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/setup/spine.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/accounting/subscription.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/addresses.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/assets/__init__.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/assets/asset.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/assets/lifecycle.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/assets/reservation.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/backlog.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/bundles.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/buying/__init__.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/buying/purchase_order.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/controllers/__init__.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/controllers/currency.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/controllers/defaults.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/controllers/item_price.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/controllers/item_prices.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/controllers/price_resolution.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/controllers/pricing_rule.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/controllers/tax_defaults.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/controllers/taxes_and_totals.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/database.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/exceptions.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/hooks.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/master_integrity.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/model.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/permissions.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/selling/__init__.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/selling/proposal.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/selling/quotation.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/selling/sales_order.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/simulation.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/stock/__init__.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/stock/consignment.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/stock/delivery_note.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/stock/purchase_receipt.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/stock/reservation.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/stock/serial.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/stock/stock_count.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/stock/stock_entry.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/stock/stock_ledger.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/timestamps.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/units.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/utils.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/validation.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/lambda_erp/workflow.py +0 -0
- {lambda_erp-1.4.25 → lambda_erp-1.4.26}/terraform/README.md +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: lambda-erp
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.26
|
|
4
4
|
Summary: Core ERP logic - accounting, sales, purchasing, inventory
|
|
5
5
|
Author: TORUS INVESTMENTS AG
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -265,8 +265,8 @@ Open `http://localhost:5173`. Vite proxies `/api/*` to the backend.
|
|
|
265
265
|
|
|
266
266
|
```
|
|
267
267
|
OPENAI_API_KEY=sk-...
|
|
268
|
-
LAMBDA_ERP_CHAT_MODEL=gpt-6.
|
|
269
|
-
LAMBDA_ERP_REPORT_MODEL=gpt-6.
|
|
268
|
+
LAMBDA_ERP_CHAT_MODEL=gpt-6.2-sol # optional chat override; default shown
|
|
269
|
+
LAMBDA_ERP_REPORT_MODEL=gpt-6.2-sol # optional specialist override; default shown
|
|
270
270
|
LAMBDA_ERP_TITLE_MODEL=gpt-6-luna # optional chat-title override; default shown
|
|
271
271
|
LAMBDA_ERP_ADMIN_EMAIL=admin@example.com # optional, seeds the admin at boot
|
|
272
272
|
LAMBDA_ERP_ADMIN_PASSWORD=... # optional, required with the line above
|
|
@@ -274,7 +274,7 @@ LAMBDA_ERP_ADMIN_NAME=Administrator # optional, display name for the seed
|
|
|
274
274
|
```
|
|
275
275
|
|
|
276
276
|
Chat, chat titles and custom-report specification generation share
|
|
277
|
-
`OPENAI_API_KEY`. The chat and the report specialist default to GPT-6.
|
|
277
|
+
`OPENAI_API_KEY`. The chat and the report specialist default to GPT-6.2 Sol,
|
|
278
278
|
titles to GPT-6 Luna; see [docs/llm-pricing.md](docs/llm-pricing.md) for prices.
|
|
279
279
|
|
|
280
280
|
**Seeded admin.** By default the first person to register becomes the admin. Set `LAMBDA_ERP_ADMIN_EMAIL` + `LAMBDA_ERP_ADMIN_PASSWORD` to instead provision that admin automatically at startup — useful when the database is recreated on every deploy, so a redeployed instance can't be claimed by whoever visits first. It's create-if-missing and idempotent (an existing account with that email is promoted to an enabled admin; its password is left untouched), and the password is only ever read from the environment.
|
|
@@ -235,8 +235,8 @@ Open `http://localhost:5173`. Vite proxies `/api/*` to the backend.
|
|
|
235
235
|
|
|
236
236
|
```
|
|
237
237
|
OPENAI_API_KEY=sk-...
|
|
238
|
-
LAMBDA_ERP_CHAT_MODEL=gpt-6.
|
|
239
|
-
LAMBDA_ERP_REPORT_MODEL=gpt-6.
|
|
238
|
+
LAMBDA_ERP_CHAT_MODEL=gpt-6.2-sol # optional chat override; default shown
|
|
239
|
+
LAMBDA_ERP_REPORT_MODEL=gpt-6.2-sol # optional specialist override; default shown
|
|
240
240
|
LAMBDA_ERP_TITLE_MODEL=gpt-6-luna # optional chat-title override; default shown
|
|
241
241
|
LAMBDA_ERP_ADMIN_EMAIL=admin@example.com # optional, seeds the admin at boot
|
|
242
242
|
LAMBDA_ERP_ADMIN_PASSWORD=... # optional, required with the line above
|
|
@@ -244,7 +244,7 @@ LAMBDA_ERP_ADMIN_NAME=Administrator # optional, display name for the seed
|
|
|
244
244
|
```
|
|
245
245
|
|
|
246
246
|
Chat, chat titles and custom-report specification generation share
|
|
247
|
-
`OPENAI_API_KEY`. The chat and the report specialist default to GPT-6.
|
|
247
|
+
`OPENAI_API_KEY`. The chat and the report specialist default to GPT-6.2 Sol,
|
|
248
248
|
titles to GPT-6 Luna; see [docs/llm-pricing.md](docs/llm-pricing.md) for prices.
|
|
249
249
|
|
|
250
250
|
**Seeded admin.** By default the first person to register becomes the admin. Set `LAMBDA_ERP_ADMIN_EMAIL` + `LAMBDA_ERP_ADMIN_PASSWORD` to instead provision that admin automatically at startup — useful when the database is recreated on every deploy, so a redeployed instance can't be claimed by whoever visits first. It's create-if-missing and idempotent (an existing account with that email is promoted to an enabled admin; its password is left untouched), and the password is only ever read from the environment.
|
|
@@ -162,14 +162,16 @@ def get_session(session_id: str) -> dict | None:
|
|
|
162
162
|
|
|
163
163
|
|
|
164
164
|
def can_access_session(session: dict | None, user: dict | None) -> bool:
|
|
165
|
+
"""Whether `user` may open, write into, rename or delete a chat: only
|
|
166
|
+
its owner, admins included. A chat holds whatever its owner typed; until
|
|
167
|
+
1.4.26 an admin could open and write into anyone's chat by its address."""
|
|
165
168
|
if not session or not user:
|
|
166
169
|
return False
|
|
167
170
|
stamp = get_db().sql('SELECT access_stamp FROM "Chat Session" WHERE id = ?', [session.get("id")])
|
|
168
171
|
if not stamp or not _session_readable(dict(stamp[0]), user.get("restrictions")):
|
|
169
172
|
return False
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
return session.get("user_id") == user.get("name")
|
|
173
|
+
owner = session.get("user_id")
|
|
174
|
+
return bool(owner) and owner == user.get("name")
|
|
173
175
|
|
|
174
176
|
|
|
175
177
|
# A session runs one agent turn at a time. The claim lives on the session row,
|
|
@@ -3391,14 +3393,14 @@ Users can attach PDFs and images (receipts, bills, contracts, screenshots) to th
|
|
|
3391
3393
|
# ---------------------------------------------------------------------------
|
|
3392
3394
|
# OpenAI report-spec specialist
|
|
3393
3395
|
#
|
|
3394
|
-
# GPT-6.
|
|
3396
|
+
# GPT-6.2 Sol acts as the planner/orchestrator. When it decides a report needs
|
|
3395
3397
|
# a custom analytics view it calls the create/update custom analytics tools.
|
|
3396
|
-
# Those handlers make a separate, narrowly prompted GPT-6.
|
|
3398
|
+
# Those handlers make a separate, narrowly prompted GPT-6.2 Sol call for the bounded
|
|
3397
3399
|
# declarative report spec. Both roles use the same provider and key (api/llm_provider.py).
|
|
3398
3400
|
# ---------------------------------------------------------------------------
|
|
3399
3401
|
|
|
3400
3402
|
|
|
3401
|
-
REPORT_SPECIALIST_MODEL = "gpt-6.
|
|
3403
|
+
REPORT_SPECIALIST_MODEL = "gpt-6.2-sol"
|
|
3402
3404
|
|
|
3403
3405
|
|
|
3404
3406
|
def _report_specialist_model() -> str:
|
|
@@ -3825,11 +3827,12 @@ async def generate_title(
|
|
|
3825
3827
|
# Reasoning loop
|
|
3826
3828
|
# ---------------------------------------------------------------------------
|
|
3827
3829
|
|
|
3828
|
-
# GPT-6.
|
|
3830
|
+
# GPT-6.2 Sol (default since core 1.4.26; GPT-6.1 Sol before) requires
|
|
3831
|
+
# Responses for function tools and does not support
|
|
3829
3832
|
# reasoning effort "none", including tool-free wrap-ups after the step limit.
|
|
3830
3833
|
# LAMBDA_ERP_CHAT_MODEL overrides it per deployment (e.g. to trial a cheaper
|
|
3831
3834
|
# model on dev); see docs/llm-pricing.md.
|
|
3832
|
-
ORCHESTRATOR_MODEL = "gpt-6.
|
|
3835
|
+
ORCHESTRATOR_MODEL = "gpt-6.2-sol"
|
|
3833
3836
|
|
|
3834
3837
|
|
|
3835
3838
|
def _chat_model() -> str:
|
|
@@ -3850,9 +3853,9 @@ def _chat_model() -> str:
|
|
|
3850
3853
|
# ---------------------------------------------------------------------------
|
|
3851
3854
|
|
|
3852
3855
|
def _use_responses_api() -> bool:
|
|
3853
|
-
# A legacy deployment flag must not route a GPT-6.1 model into an
|
|
3856
|
+
# A legacy deployment flag must not route a GPT-6.1 / 6.2 model into an
|
|
3854
3857
|
# unsupported API.
|
|
3855
|
-
if _chat_model().startswith("gpt-6.1-"):
|
|
3858
|
+
if _chat_model().startswith(("gpt-6.1-", "gpt-6.2-")):
|
|
3856
3859
|
return True
|
|
3857
3860
|
# Default: the Responses API (needed for Office attachments + native
|
|
3858
3861
|
# reasoning). Set ERP_CHAT_API=chat to fall back to Chat Completions.
|
|
@@ -4016,7 +4019,7 @@ def _shim_usage_from_responses(usage):
|
|
|
4016
4019
|
|
|
4017
4020
|
def _orchestrator_turn(client, messages, tools, max_tokens, *, tool_choice="auto"):
|
|
4018
4021
|
"""One orchestrator LLM turn. Returns (message, usage) shaped like Chat
|
|
4019
|
-
Completions. GPT-6.1 models always use Responses; others honor ERP_CHAT_API.
|
|
4022
|
+
Completions. GPT-6.1 and 6.2 models always use Responses; others honor ERP_CHAT_API.
|
|
4020
4023
|
Blocking — call via asyncio.to_thread."""
|
|
4021
4024
|
if _use_responses_api():
|
|
4022
4025
|
instructions, input_items = _responses_request_from_chat(messages)
|
|
@@ -4069,11 +4072,11 @@ async def run_thinking_loop(
|
|
|
4069
4072
|
):
|
|
4070
4073
|
"""Run the agentic reasoning loop.
|
|
4071
4074
|
|
|
4072
|
-
The orchestrator and the report specialist use GPT-6.
|
|
4075
|
+
The orchestrator and the report specialist use GPT-6.2 Sol.
|
|
4073
4076
|
When GPT decides to call
|
|
4074
4077
|
`create_custom_analytics_report` or `update_custom_analytics_report`
|
|
4075
4078
|
with an intent/feedback hint, the tool handler itself delegates the
|
|
4076
|
-
declarative-spec step to a separate narrowly prompted GPT-6.
|
|
4079
|
+
declarative-spec step to a separate narrowly prompted GPT-6.2 Sol call. We emit an
|
|
4077
4080
|
`llm_provider` event around that delegation so the UI can surface it.
|
|
4078
4081
|
"""
|
|
4079
4082
|
if not llm_configured():
|
|
@@ -4288,7 +4291,7 @@ async def run_thinking_loop(
|
|
|
4288
4291
|
principal_ref[0] = refresh_auth_principal(principal_ref[0])
|
|
4289
4292
|
live_role = principal_ref[0].get("role") if principal_ref[0] else None
|
|
4290
4293
|
|
|
4291
|
-
# If the orchestrator is delegating report-spec generation to GPT-6.
|
|
4294
|
+
# If the orchestrator is delegating report-spec generation to GPT-6.2 Sol,
|
|
4292
4295
|
# surface the handoff in the UI.
|
|
4293
4296
|
will_delegate_to_report_specialist = (
|
|
4294
4297
|
tool_allowed(fn_name, live_role)
|
|
@@ -19,7 +19,22 @@ from typing import Any, Optional
|
|
|
19
19
|
# ---------------------------------------------------------------------------
|
|
20
20
|
|
|
21
21
|
OPENAI_PRICING: dict[str, dict[str, Any]] = {
|
|
22
|
-
|
|
22
|
+
"gpt-6.2-astra": {
|
|
23
|
+
"tiered": True,
|
|
24
|
+
"tiers": [
|
|
25
|
+
{"max_input_tokens": 272_000, "input": 8.00, "cached_input": 0.40, "cache_write": 10.00, "cache_write_12h": 20.00, "output": 40.00},
|
|
26
|
+
{"max_input_tokens": None, "input": 16.00, "cached_input": 0.80, "cache_write": 20.00, "cache_write_12h": 40.00, "output": 60.00},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
"gpt-6.2-sol": {
|
|
30
|
+
"tiered": True,
|
|
31
|
+
"tiers": [
|
|
32
|
+
{"max_input_tokens": 272_000, "input": 2.00, "cached_input": 0.10, "cache_write": 2.50, "cache_write_12h": 5.00, "output": 10.00},
|
|
33
|
+
{"max_input_tokens": None, "input": 4.00, "cached_input": 0.20, "cache_write": 5.00, "cache_write_12h": 10.00, "output": 15.00},
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
# The models available to us, Standard tier, verified 2026-10-30 (the
|
|
37
|
+
# GPT-6.2 models 2026-11-18, developers.openai.com/api/docs/pricing). Above
|
|
23
38
|
# 272K input tokens the higher rates apply to the entire request
|
|
24
39
|
# (including cache hits). cache_write is the 30-minute retention rate,
|
|
25
40
|
# cache_write_12h the 12-hour one.
|
|
@@ -62,14 +77,14 @@ TRANSCRIBE_PRICING: dict[str, dict[str, float]] = {
|
|
|
62
77
|
|
|
63
78
|
|
|
64
79
|
# ---------------------------------------------------------------------------
|
|
65
|
-
# Rate lookup — unknown model IDs are estimated at the gpt-6.
|
|
80
|
+
# Rate lookup — unknown model IDs are estimated at the gpt-6.2-sol rates.
|
|
66
81
|
# Register a model explicitly before using it; this fallback is not a price cap.
|
|
67
82
|
# ---------------------------------------------------------------------------
|
|
68
83
|
|
|
69
84
|
def get_openai_rates(model: str, input_tokens: int = 0) -> dict[str, float]:
|
|
70
85
|
entry = OPENAI_PRICING.get(model)
|
|
71
86
|
if entry is None:
|
|
72
|
-
entry = OPENAI_PRICING["gpt-6.
|
|
87
|
+
entry = OPENAI_PRICING["gpt-6.2-sol"]
|
|
73
88
|
if entry.get("tiered"):
|
|
74
89
|
for tier in entry["tiers"]:
|
|
75
90
|
cap = tier.get("max_input_tokens")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|