Prompt "profiles": serializable bundles of system prompt + tools + schema
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- python
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
Bắt đầu bằng cách đọc chatlas/_interpolate.py và chatlas/_chat.py, đặc biệt là interpolate(), chat_structured(), set_model_params() và các phương thức công cụ. Giải quyết các câu hỏi còn bỏ ngỏ về phạm vi tuần tự hóa và điểm bắt đầu của việc tạo, sau đó xác minh rằng một Profile có thể giữ nguyên system_prompt, data_model và params qua một round-trip, đồng thời tạo một Chat với nội suy. Việc đóng gói công cụ nằm ngoài các tiêu chí hoàn thành ban đầu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Motivation
Simon Willison's llm has templates: YAML bundles of system prompt, prompt fragments, model options, tools, and schemas, invoked via llm -t name. This lets users package up a reusable "agent config" and share it as a file. chatlas has the pieces (interpolate()/interpolate_file() in chatlas/_interpolate.py, register_tool()/set_tools() and chat_structured(data_model=...) in chatlas/_chat.py, set_model_params()), but nothing that bundles them into one serializable, shareable unit. Pydantic AI has a related but narrower idea in reusable Agent instances, though those aren't declaratively serializable either.
Proposed approach
Introduce a Profile object — a thin, serializable bundle of the inputs to a Chat, not a new execution engine:
from chatlas import Profile, ChatOpenAI
profile = Profile(
system_prompt="You are a terse SQL assistant.\n{{ extra_instructions }}", # interpolate() template
data_model="myapp.schemas.SqlAnswer", # optional, import-path string
params={"temperature": 0.2},
)
chat = profile.create_chat(ChatOpenAI, variables={"extra_instructions": "Always cite the table."})
Profile.from_yaml(path)/Profile.to_yaml(path)(or TOML) for round-tripping.system_promptis rendered throughinterpolate()atcreate_chat()time, so the same template mechanics/variable-inference already in_interpolate.pyapply.data_modelandparamsmap directly ontochat_structured(data_model=...)andset_model_params().- Tools are the hard part. Functions aren't YAML-serializable. Two honest options: (a) store an import path string (
"myapp.tools:lookup_price") resolved viaimportlibat load time — simple, but ties the profile to code being importable in the same environment; (b) require a small in-app registry mapping names to callables that the profile references by name only. Given this complexity, the proposal is to ship the non-tool subset first (system prompt + data_model + params, dumpable/loadable), and treat tool bundling as a stretch goal / separate follow-up once the serialization approach is validated with users.
Alternatives / prior art
- ellmer has
interpolate()(string-only) and no bundling concept beyond that — this would be new territory for both projects, so getting the design right in chatlas first and porting later (as usual) seems reasonable. - Do nothing: users keep hand-rolling a
dict/module of prompt+schema+params, which works but isn't shareable as a file the wayllm's templates are. - A pure-YAML "recipe" that only ever produces kwargs for
ChatAuto(**kwargs)(no new class) is a lighter-weight alternative worth considering.
Open questions
- Is
create_chat()the right entry point, or should this be aChat*(profile=...)constructor kwarg instead (per the original ask)? - YAML vs TOML vs both?
- Should
Profilealso carry the provider/model string (à laChatAuto's"provider/model"), or stay provider-agnostic and let the caller pick theChat*class?
Drafted from a competitive review of llm / Pydantic AI / LangChain / LiteLLM (July 2026); filed via Claude Code on behalf of @cpsievert.
- Ngôn ngữ chính
- Python
- Star
- 179
- Fork
- 32
- Merge trung bình
- 1 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 10
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của posit-dev/chatlas
-
A streaming text delta that repeats everything streamed so far is missing from the recorded turnCó thể đã có người làm @cpsievert đã nhận 81 ngày trước. Đang mởai-triage:done Priority: Medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-triage:needs-review documentation
Độ khó 2/5 1-2 ngày Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-triage:done Priority: Low
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của posit-dev/chatlas
Issue tương tự
-
bot-triaged module: decompositions module: edge cases module: int overflow module: primTorch oncall: pt2 triage review
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[TV SHOW]: Dynasty (1981)Đang mởcountry:US rating:6 request-theme type:TV SHOW
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
LizardByte/ThemerrDB#10501 · 1 bình luận ·
-
triage/confirmed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
agentscope-ai/agentscope#4563 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
comp/desktop desktop/chat P3 type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
NousResearch/hermes-agent#164451 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
external integration integration-submission
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
langchain-ai/docs#8426 ·
Maintainer thường phản hồi trong vòng 1 ngày