Documentation
API References

API References

Authentication

SoftlyAI AI Chat API를 활용하기 위해서는 우선 API Key 발급을 받아야 합니다. 이를 위해서는 링크 (opens in a new tab)를 통해 데모 신청을 해주셔야 하며, 이미 발급받은 API Key는 대시보드에서 확인하실 수 있습니다.

Content-Type: application/json; charset=utf8
x-api-key: $SOFTLY_API_KEY

Docsets

SoftlyAI의 AI 챗봇이 참고할 문서 집합을 생성하거나 조회하고, 생성된 문서 집합에 문서를 추가할 수 있습니다. Docset이 사용되는 목적과 각 목적별 설명은 다음 링크에서 확인하실 수 있습니다.

Create Docset

POST https://qa.softly.ai/docsets

SoftlyAI의 AI 챗봇이 답변 생성에 사용할 문서 집합을 생성합니다.

Request Body

namestringRequired

생성할 Docset의 이름

*다음 낱말만 활용하여 Docset 이름을 만들어 주세요. - 소문자 영문자 : az - 대문자 영문자 : AZ - 숫자 : 0~9 - 밑줄 (underscore) : _

Example Request
curl -X "POST" \
  "https://qa.softly.ai/docsets" \
  -H "accept: application/json" \
  -H "x-api-key: $SOFTLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "docset_name"}'
Response
{
  "id": 1
}
이 때 반환된 id는 생성된 Docset의 id입니다.

Upload Documents to Docset

POST https://qa.softly.ai/docsets/{docset_id}/documents

문서 집합에 문서를 업로드합니다.

*더 다양한 파일 유형을 지원할 예정이며, 현재는 .pdf 만 지원하고 있습니다.


*문서 파일은 최대 9Mb까지 업로드 가능합니다.

Path Parameter

docset_idintegerRequired

Docset의 id

Form Body

filestringRequired

업로드 할 문서 (binary)

openai_api_keystringRequired

답변 생성에 사용할 OpenAI API Key

Example Request
curl -X "POST" \
  "https://qa.softly.ai/docsets/1/documents" \
  -H "accept: application/json" \
  -H "x-api-key: $SOFTLY_API_KEY" \
  -H "Content-Type: multipart/form-data" \
  -F "file=@$YOUR_PDF_PATH;type=application/pdf" \
  -F "openai_api_key=$OPENAI_API_KEY"
Respone
{
  "id": 1,
  "docset_id": 1,
  "filename": "string",
  "status": "UPLOADING"
}

Get Documents from Docset

GET https://qa.softly.ai/docsets/{docset_id}/documents/{doc_id}

문서 집합에 업로드된 문서를 조회합니다. 이를 통해 해당 문서의 인덱싱 작업이 완료되었는지 확인할 수 있습니다. 인덱싱 처리 상태는 다음 페이지에서 확인하실 수 있습니다.

*더 다양한 언어를 추후 지원할 예정이며, 현재는 한국어와 영어로 작성 된 문서만 유효합니다.

Path Parameter

docset_idintegerRequired
Docset의 id
doc_idintegerRequired
Document의 id
Example Request
curl -X "GET" \
  "https://qa.softly.ai/docsets/1/documents/1" \
  -H "accept: application/json" \
  -H "x-api-key: $SOFTLY_API_KEY"
Response
{
  "id": 1,
  "docset_id": 1,
  "filename": "string",
  "status": "INDEXED"
}

Query Docset

POST https://qa.softly.ai/docsets/${docset_id}/query

생성된 문서 집합을 활용해 AI 챗봇에게 질문을 발송합니다.

Path Parameter

docset_idstringRequired
Docset의 id

Request Body

questionstringRequired
AI 챗봇에게 전달할 질문
top_kintegerOptionalDefaults to 5
답변 생성에 참고할 문단 갯수
generation_modelstringOptionalDefaults to gpt-3.5-turbo-16k

답변 생성에 사용할 생성 AI모델

  • gpt-4
  • gpt-4-0613
  • gpt-3.5-turbo
  • gpt-3.5-turbo-16k (기본값)
  • gpt-3.5-turbo-0613
  • gpt-3.5-turbo-16k-0613
openai_api_keystringRequired
답변 생성에 사용할 OpenAI API Key
Example Request
curl -X "POST" \
  "https://qa.softly.ai/docsets/1/query" \
  -H "accept: application/json" \
  -H "x-api-key: $SOFTLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
        "question": "생성형 ai는 지식 노동자의 시간을 어떻게 줄여줄 수 있어?",
        "top_k": 6,
        "generation_model": "gpt-4",
        "openai_api_key": "$OPENAI_API_KEY"
      }'
Response
{
  "answer": "생성형 AI는 지식 노동자의 시간을 줄이는 데 큰 영향을 미칠 수 있습니다. 이전의 자동화 기술은 데이터 관리 작업, 특히 데이터 수집 및 처리와 관련된 작업을 자동화하는 데 특히 효과적이었습니다. 생성형 AI의 자연어 처리 능력은 이러한 유형의 활동의 자동화 가능성을 증가시킵니다 [the-economic-potential-of-generative-ai-the-next-productivity-frontier-vf.pdf p.42].
 
  예를 들어, 대학 영어 언어 및 문학 교수들의 작업 활동 중 일부는 시험 준비 및 학생 작업 평가를 포함합니다. 생성형 AI의 향상된 자연어 처리 능력을 활용하면, 이러한 활동 중 더 많은 부분이 기계에 의해 수행될 수 있습니다. 이는 교사들이 클래스 토론을 지도하거나 추가 지원이 필요한 학생들을 가르치는 등의 다른 작업 활동에 더 많은 시간을 할애할 수 있게 해줍니다 [the-economic-potential-of-generative-ai-the-next-productivity-frontier-vf.pdf p.39].
 
  또한, 생성형 AI는 내부 지식 관리 시스템을 혁신하여 전체 조직에 가치를 제공할 수 있습니다. 생성형 AI의 뛰어난 자연어 처리 능력은 직원들이 사람에게 질문을 하거나 대화를 이어가는 것과 같은 방식으로 쿼리를 작성하여 저장된 내부 지식을 검색하는 데 도움을 줄 수 있습니다. 이는 팀이 빠르게 관련 정보에 접근하고, 더 빠르게 더 잘 정보를 기반으로 한 결정을 내리고 효과적인 전략을 개발할 수 있게 해줍니다 [the-economic-potential-of-generative-ai-the-next-productivity-frontier-vf.pdf p.15].",
  "relevant_docs": [
    {
      "filename": "the-economic-potential-of-generative-ai-the-next-productivity-frontier-vf.pdf",
      "page": 42,
      "total_pages": 68,
    },
    {
      "filename": "the-economic-potential-of-generative-ai-the-next-productivity-frontier-vf.pdf",
      "page": 39,
      "total_pages": 68,
    },
    {
      "filename": "the-economic-potential-of-generative-ai-the-next-productivity-frontier-vf.pdf",
      "page": 48,
      "total_pages": 68,
    },
    {
      "filename": "the-economic-potential-of-generative-ai-the-next-productivity-frontier-vf.pdf",
      "page": 22,
      "total_pages": 68,
    },
    {
      "filename": "the-economic-potential-of-generative-ai-the-next-productivity-frontier-vf.pdf",
      "page": 15,
      "total_pages": 68,
    },
    {
      "filename": "the-economic-potential-of-generative-ai-the-next-productivity-frontier-vf.pdf",
      "page": 15,
      "total_pages": 68,
    },
  ]
}