8000 [Settings] 인터페이스 계약 확정(contracts.md, contracts.py) · Issue #10 · SM17-YoonDongJu/AI · GitHub
[go: up one dir, main page]

Skip to content

[Settings] 인터페이스 계약 확정(contracts.md, contracts.py) #10

Open

Description

@jongyo0N

개요

모든 워커·공용 모듈의 통합 경계. 이 계약이 고정돼야 RAG / 가드레일 / LangGraph /
챗봇이 서로 안 부딪히고 병렬 개발할 수 있다. 다른 모든 구현 이슈의 선행 조건.
docs/contracts.md(초안)를 확정해 core/contracts.py에 pydantic으로 박는다.

구현 범위

  • Kafka 메시지: OcrJob, ReportJob + 토픽 상수, doc_type enum
  • WebSocket 메시지: ChatClientMessage, ChatServerMessage(비스트리밍)
  • DB 교차 스키마 확정: ocr_results, report_drafts (필드·보존정책)
  • RAG 시그니처: search() -> RagResult + Chunk/Citation
  • 가드레일 시그니처: guard_input/generation/output() +
    InputGuardResult/OutputGuardResult
  • ai_client 시그니처: chat(), embed()(1024d) — 모델 독립
  • docs/contracts.md ↔ core/contracts.py 일치, pydantic v2 검증
  • 계약 단위 테스트(직렬화/역직렬화 round-trip)

주의사항

  • Day 0 최우선 — 미확정이면 A/B/C 병렬 시작 불가
  • 외부 합의 필요: OcrJob 필드는 Spring 팀과, report_drafts는 손해사정사 UI와 합의
  • 추적 ID 흐름 결정: 요청 시점 report_id 발급 여부, job_id↔report_id 연결 방식
  • 변경 정책: 추가(backward-compatible) 우선, 삭제·타입변경은 발행/소비 양측 동시 배포
  • 모델 미정 → ai_client는 base_url/model을 config로만, 시그니처는 모델 비의존
  • 임베딩 차원 1024 고정, PII는 계약에 평문 금지
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

AIFeatureNew feature or request

Type

No type

Projects

  • Status
    In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

0