SDKs
Official SDKs are available for JavaScript/TypeScript and Python.
JavaScript / TypeScript
Install from npm:
npm install @godfocus/platform-sdk
Or with pnpm:
pnpm add @godfocus/platform-sdk
Quickstart:
import { GodFocusClient } from "@godfocus/platform-sdk";
const client = new GodFocusClient({
apiKey: process.env.GODFOCUS_API_KEY
});
// Health check
const health = await client.health();
console.log(health.balance);
// Bible search
const { verses } = await client.bible.search({
query: "love thy neighbor",
top_k: 5,
theme: "love"
});
// Streaming ask
for await (const event of client.bible.ask({ question: "What is grace?" })) {
if (event.token) process.stdout.write(event.token);
}
View on npm.
Python
Install from PyPI:
pip install godfocus
Quickstart:
from godfocus import GodFocusClient
import os
client = GodFocusClient(api_key=os.environ["GODFOCUS_API_KEY"])
# Health check
health = client.health()
print(health["balance"])
# Bible search
result = client.bible.search(
query="love thy neighbor",
top_k=5,
theme="love"
)
print(result["verses"])
# Streaming ask
for event in client.bible.ask(question="What is grace?"):
if "token" in event:
print(event["token"], end="", flush=True)
View on PyPI.
Type safety
The TypeScript SDK ships with full type definitions. All request and response types are exported:
import type { BibleSearchRequest, BibleSearchResponse } from "@godfocus/platform-sdk";