Skip to content

2025-open-source-TOPGEON/Synthor-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Synthor-AI

자연어로 데이터 필드 제약조건을 자동 생성하는 AI 서비스

Python FastAPI Docker License

개요

Synthor-AI는 자연어 설명을 통해 데이터베이스 필드의 제약조건을 자동으로 생성하는 AI 서비스입니다. 개발자가 "비밀번호는 최소 10자 이상이고 숫자와 특수문자가 포함되어야 해"와 같은 자연어 설명을 입력하면, AI가 이를 분석하여 적절한 필드 타입과 제약조건을 자동으로 생성합니다.

주요 기능

  • 개별 필드 제약조건 생성: 자연어로 필드 설명을 입력하면 제약조건 자동 생성
  • 전체 필드 세트 자동 생성: 시스템 목적을 설명하면 필요한 모든 필드 자동 생성
  • 다국어 지원: 한국어와 영어 자연어 처리 지원
  • 다양한 데이터 타입: 비밀번호, 이메일, 전화번호, 날짜/시간, 신용카드 등 20+ 타입 지원
  • RESTful API: FastAPI 기반의 현대적인 API 제공
  • Docker 지원: 컨테이너화된 배포 환경

빠른 시작

Docker로 실행

# 저장소 클론
git clone https://github.com/2025-open-source-TOPGEON/Synthor-AI.git
cd Synthor-AI/ai-synthor

# Docker Compose로 실행
docker compose up -d

# 또는 자동 배포 스크립트 사용 (파일이 있는 경우만)
chmod +x deploy.sh
./deploy.sh

로컬 개발 환경

# Python 3.11+ 설치 필요
cd ai-synthor

# 가상환경 생성 및 활성화
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate

# 의존성 설치
pip install -r requirements.txt

# 서버 실행
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000

접속 정보

자연어 입력 예시

여기 제시된 예시는 일부 사례이며,다른 필드 타입과 다양한 입력 값 또한 지원됩니다. 아직 다른 타입에 대한 테스트는 제한적이지만, 추후 더 많은 필드 조건을 인식하고 다양한 타입을 처리할 수 있도록 확장할 예정입니다. ➡️ 자연어 입력 테스트 보기

API 사용법

1. 개별 필드 제약조건 생성

curl -X POST "https://synthor-ai.onrender.com/api/fields/ai-suggest" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "between 2023-01-05 and 2023-12-31"
  }'

응답 예시:

{
  "type": "datetime",
  "constraints": {
    "from": "2023-01-05",
    "to": "2023-12-31",
    "format": "m/d/yyyy"
  },
  "nullablePercent": 0
}

2. 전체 필드 세트 자동 생성

curl -X POST "https://synthor-ai.onrender.com/api/fields/auto-generate" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "쇼핑몰에서 사용자 등록을 위한 정보"
  }'

응답 예시:

 {'count': 6,
'fields': [{'name': 'full_name', 'type': 'full_name', 'constraints': {}, 'nullablePercent': 0},
{'name': 'email', 'type': 'email_address', 'constraints': {}, 'nullablePercent': 0},
{'name': 'password', 'type': 'password', 'constraints': {'minimum_length': 8}, 'nullablePercent': 0},
{'name': 'address', 'type': 'address', 'constraints': {}, 'nullablePercent': 0},
{'name': 'phone', 'type': 'phone', 'constraints': {}, 'nullablePercent': 0},
{'name': 'birth_date', 'type': 'datetime', 'constraints': {'format': 'yyyy-mm-dd'}, 'nullablePercent': 0}]}

프로젝트 구조

지원하는 데이터 타입

기본 타입

  • 비밀번호 (password): 길이, 문자 조합 제약조건
  • 이메일 (email_address): 이메일 형식 검증
  • 전화번호 (phone): 국가별 전화번호 형식
  • 날짜/시간 (datetime): 날짜 범위, 형식 지정
  • 시간 (time): 시간 형식 및 범위
  • URL (url): URL 형식 검증
  • 신용카드 (credit_card_number, credit_card_type): 카드 번호 및 타입
  • 문단 (paragraphs): 문단 수 및 길이 제약조건

개인정보 타입

  • 이름 (full_name, first_name, last_name)
  • 주소 (address, street_address, city, state, country, postal_code)
  • 회사 정보 (company_name, job_title, department_corporate, department_retail)

한국어 특화 타입

  • 한국어 이름 (korean_full_name, korean_first_name, korean_last_name)
  • 한국어 주소 (korean_address, korean_street_address, korean_city, korean_state, korean_country)
  • 한국어 회사 정보 (korean_company_name, korean_job_title)

기타 타입

  • 아바타 (avatar): 프로필 이미지
  • 숫자 범위 (number_between): 최소/최대값 제약조건
  • 제품 정보 (product_name, product_category, product_description, product_price)
  • 기술 정보 (mac_address, ip_v4_address, ip_v6_address, user_agent)

다국어 지원

한국어 예시

{
  "prompt": "비밀번호는 최소 12자 이상이고 대문자 2개, 소문자 2개, 숫자 2개, 특수문자 2개 포함, 이메일은 naver.com"
}

영어 예시

{
  "prompt": "Password minimum 10 characters with uppercase, lowercase, numbers, symbols. Email only gmail.com"
}

혼합어(영어+한국어) 예시

{
  "prompt": "연령 less than or equal to 30"
}

테스트

# API 테스트
curl -X GET "https://synthor-ai.onrender.com/healthz"

# Swagger UI를 통한 인터랙티브 테스트
# https://synthor-ai.onrender.com/docs 접속

기여 가이드 (How to Contribute)

이 프로젝트는 오픈 소스 프로젝트로 누구나 기여할 수 있습니다.
아래 절차를 따라 참여해주세요:

  1. 이 저장소를 포크합니다
  2. 새로운 기능 브랜치를 생성합니다 (git checkout -b feature/amazing-feature)
  3. 변경사항을 커밋합니다 (git commit -m 'Add some amazing feature')
  4. 브랜치에 푸시합니다 (git push origin feature/amazing-feature)
  5. Pull Request를 생성합니다

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages