Query
POST Generate AI Completion
POST Generate AI CompletionField
Type
Required
Default
Description
from databridge import DataBridge
db = DataBridge(uri="your-databridge-uri")
# Generate completion
response = db.query(
query="What are the main applications of machine learning?",
filters={"category": "tech"},
k=3,
max_tokens=150,
temperature=0.7
)
print("Answer:", response.completion)
print(f"Total tokens used: {response.usage.total_tokens}")curl -X POST "http://localhost:8000/query" \
-H "Authorization: Bearer your_token" \
-H "Content-Type: application/json" \
-d '{
"query": "What are the main applications of machine learning?",
"filters": {
"category": "tech"
},
"k": 3,
"max_tokens": 150,
"temperature": 0.7
}'Last updated