Introduce # objects with ## methods (handles + ` x.method `), ship OpenAI-compatible ext/llm, and upgrade net/sys for HTTPS headers and dotenv loading. Co-authored-by: Cursor <cursoragent@cursor.com>
1.4 KiB
1.4 KiB
Official extensions (ext/)
| Status | Accepted (v0.1.x) |
| Date | 2026-08-06 |
| Related | objects.md |
Scope
ext/ holds official optional extensions shipped with Marqdo. They are not stdlib (lib/). Users import only what they need:
---
> ext/llm.mq.md
---
Resolution: MARQDO_EXT, ./ext, ext/ next to the binary (same pattern as MARQDO_LIB).
Platform prerequisites
| Capability | Surface |
|---|---|
| HTTPS + headers | lib/net → http_post / headers= map |
| Dotenv | ## load_env in ext (or load_dotenv host) |
| JSON quote | lib/json → quote |
ext/llm / ext/大模型 (object handles)
| English | Chinese | Role |
|---|---|---|
## load_env |
## 加载环境 |
Free function: load .env |
# llm |
# 大模型 |
Object ctor → handle map |
## complete / ## chat |
## 运行 / ## 聊天 |
Methods on the handle |
---
> ext/llm.mq.md
---
# main
> load_env
*`model` = > llm *
*`reply` = > `model`.complete prompt=Say hi in one word *
> print text=`reply`
Environment (create a project-local .env; do not commit secrets):
OPENAI_API_KEY=sk-...
OPENAI_BASE_URL=https://api.openai.com/v1
OPENAI_MODEL=gpt-4o-mini
Fallbacks: MARQDO_LLM_API_KEY, MARQDO_LLM_BASE_URL, MARQDO_LLM_MODEL.