from r2r import R2RClient
client = R2RClient('https://api.intelligence.io.solutions/api/r2r')
client.set_api_key('<your-io-API-key>')
response = client.retrieval.completion(
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is the capital of France?"},
{"role": "assistant", "content": "The capital of France is Paris."},
{"role": "user", "content": "What about Italy?"}
],
generation_config={
"model": "hosted_vllm/openai/gpt-oss-120b",
"temperature": 0.7,
"max_tokens": 150,
"stream": False
}
)
print(response)
{
"results": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"collection_ids": [
"123e4567-e89b-12d3-a456-426614174000"
],
"owner_id": "123e4567-e89b-12d3-a456-426614174000",
"document_type": "pdf",
"metadata": {
"title": "My Sample Document"
},
"version": "1.0",
"title": "Sample Document",
"size_in_bytes": 123456,
"ingestion_status": "pending",
"extraction_status": "pending",
"created_at": "2021-01-01T00:00:00Z",
"updated_at": "2021-01-01T00:00:00Z",
"ingestion_attempt_number": 0,
"summary": "A summary of the document",
"summary_embedding": [
0.1,
0.2,
0.3
],
"total_tokens": 1000,
"chunks": [
{
"key": "value"
}
]
}
}Modify document metadata, given the document ID
from r2r import R2RClient
client = R2RClient('https://api.intelligence.io.solutions/api/r2r')
client.set_api_key('<your-io-API-key>')
response = client.retrieval.completion(
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is the capital of France?"},
{"role": "assistant", "content": "The capital of France is Paris."},
{"role": "user", "content": "What about Italy?"}
],
generation_config={
"model": "hosted_vllm/openai/gpt-oss-120b",
"temperature": 0.7,
"max_tokens": 150,
"stream": False
}
)
print(response)
{
"results": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"collection_ids": [
"123e4567-e89b-12d3-a456-426614174000"
],
"owner_id": "123e4567-e89b-12d3-a456-426614174000",
"document_type": "pdf",
"metadata": {
"title": "My Sample Document"
},
"version": "1.0",
"title": "Sample Document",
"size_in_bytes": 123456,
"ingestion_status": "pending",
"extraction_status": "pending",
"created_at": "2021-01-01T00:00:00Z",
"updated_at": "2021-01-01T00:00:00Z",
"ingestion_attempt_number": 0,
"summary": "A summary of the document",
"summary_embedding": [
0.1,
0.2,
0.3
],
"total_tokens": 1000,
"chunks": [
{
"key": "value"
}
]
}
}from r2r import R2RClient
client = R2RClient('https://api.intelligence.io.solutions/api/r2r')
client.set_api_key('<your-io-API-key>')
response = client.retrieval.completion(
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is the capital of France?"},
{"role": "assistant", "content": "The capital of France is Paris."},
{"role": "user", "content": "What about Italy?"}
],
generation_config={
"model": "hosted_vllm/openai/gpt-oss-120b",
"temperature": 0.7,
"max_tokens": 150,
"stream": False
}
)
print(response)
The access token received from the authorization server in the OAuth 2.0 flow.
JWT token
io.net provided API Key
API key set by an SDK client
Document ID
200
Show child attributes
Was this page helpful?