C.W.K.
Stream
Lesson 01 of 07 · published

Adapter Pattern — wire 에, prompt 에 X

~22 min · adapter, production

Level 0Tokenizer
0 XP0/54 lessons0/10 achievements
0/120 XP to next level120 XP to go0% complete

Provider 차이는 wire 에서 살아 — streaming 방식, tool result 보내는 법, authentication 방식. Prompt 와 tool 은 provider 별로 달라지면 안 돼. 달라진다면 adapter 가 너무 좁게 잡혔어.

Leak point 점검

코드에서 'provider' 가 등장하는 곳 list. 두 그룹으로 분류 — (a) 합법적 wire 차이 (auth, request body shape, streaming format), (b) 버그 (prompt 또는 tool variation). 그룹 b 는 consolidation 대상.

cwkPippa 의 boundary

cwkPippa 는 backend/adapters/base.py 가 model-API 차이가 매터하는 유일한 곳. Routes, store, frontend 는 모두 Claude shape 가정. Codex/Gemini/Ollama vessel 들은 backend/variants/ 에서 specialize — boundary 안 넓힘.

Anti-pattern

'OpenAI 일 땐 X 프롬프트, Claude 일 땐 Y 프롬프트' = adapter 가 너무 좁음. Wire 에서만 차이 처리, prompt 는 unify. 모델별 prompt tuning 은 다른 layer 의 일.

Code

Production Adapter ABC sketch·python
# Map tool names to callables for the agent loop
TOOLS_MAP = {
    "get_weather": get_weather,
    "search_news": search_news,
    "query_database": query_database,
}

# Tool schemas for the model
TOOL_SCHEMAS = [
    {"type": "function", "name": name, "description": func.__doc__,
     "parameters": get_schema(func), "strict": True}
    for name, func in TOOLS_MAP.items()
]

External links

Exercise

코드에서 'provider' 가 등장하는 leak point list. 두 그룹 — (a) 합법적 wire 차이, (b) prompt/tool variation (버그). 1 개 consolidation plan.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.