main
md 43 lines 2.16 KB
Rendered Raw
1 # call_llm.py DOX
2
3 ## Purpose
4
5 - Own the `call_llm.py` helper module.
6 - This module wraps LiteLLM/model calls with examples, streaming, and extension hooks.
7 - Keep this file-level DOX profile synchronized with `call_llm.py` because this directory is intentionally flat.
8
9 ## Ownership
10
11 - `call_llm.py` owns the runtime implementation.
12 - `call_llm.py.dox.md` owns durable notes about responsibilities, contracts, side effects, and verification for that implementation.
13 - Classes:
14 - `Example` (`TypedDict`)
15 - Top-level functions:
16 - `async call_llm(system: str, model: BaseChatModel | BaseLLM, message: str, examples: list[Example]=..., callback: Callable[[str], None] | None=...)`
17
18 ## Runtime Contracts
19
20 - Helper modules own reusable framework APIs and must preserve public callers unless all callers, tests, and docs are updated together.
21 - Update this file whenever public functions, classes, persistence behavior, path/security assumptions, side effects, or cross-module contracts change.
22 - Observed side-effect areas: model calls.
23 - Imported dependency areas include: `langchain.prompts`, `langchain.schema`, `langchain_core.language_models.chat_models`, `langchain_core.language_models.llms`, `langchain_core.messages`, `typing`.
24
25 ## Key Concepts
26
27 - Important called helpers/classes observed in the source: `ChatPromptTemplate.from_messages`, `FewShotChatMessagePromptTemplate`, `few_shot_prompt.format`, `chain.astream`, `HumanMessage`, `AIMessage`, `SystemMessage`, `callback`.
28 - Keep request/response, tool, or helper semantics documented here at the same time as source changes.
29
30 ## Work Guidance
31
32 - Preserve public helper APIs used by core code and plugins unless every caller is updated.
33 - Keep path, auth, secret, persistence, network, and subprocess behavior explicit and bounded.
34 - Prefer adding cohesive helper functions here only when behavior is reused across modules.
35
36 ## Verification
37
38 - Run targeted tests for changed helper behavior; run security regressions for auth, filesystem, WebSocket, tunnel, upload, or secret-handling helpers.
39 - No direct test reference was found by name search; choose the nearest behavioral test or perform a focused smoke check.
40
41 ## Child DOX Index
42
43 No child DOX files.