> ## Documentation Index
> Fetch the complete documentation index at: https://developer.qaip.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# SDK イントロダクション

> QAIPはPython SDKを提供しています。SDKを利用することで、簡単にQAIPの機能をアプリケーションに組み込むことができます。

## 主な機能

現在は6つの主要な機能を提供しています。

* `/completions`: チャット形式で質問に答えます。
* `/search`: ドキュメントを文章やキーワードで検索します。
* `/contents/{id}`: コンテンツIDを指定してドキュメントの内容を取得します。
* `/extract`: 指定したドキュメントから特定の情報を抽出します。
* `/tags`: 登録したドキュメントのタグ一覧を取得します。
* `/tag-source-groups`: ソースグループにタグをつけたり、タグを削除したりします。ソースグループとは、1つのジョブで取り込んだファイル群です。

### インストール

QAIPのAPIを呼び出すためにSDKをインストールします：

```bash theme={null}
pip install qaip
```

### サンプルスクリプト

```python theme={null}
from qaip import Qaip
client = Qaip()

result = client.completion(
    messages=[{"role": "user", "content": "QAIPの主な機能について教えてください"}],
    citation=True,
)

for choice in result.choices:
    print(f"Assistant: {choice.message.content}")
    if choice.citations:
        print("\n引用元:")
        for i, citation in enumerate(choice.citations):
            print(f"- {i+1}: {citation.url}")
```
