Namespaces
ovok.ai
Translate text, chat with an AI assistant, and search FHIR data in natural language.
- Stable unknown
- Release candidate since 0.4.49-rc.4
- Development since 0.4.49-dev.517+4645a0a
AI features of the Ovok API, called by a signed-in app. Routes live under ai.
Translate text
const result = await ovok.ai.translate({
sourceLanguage: 'en',
targetLanguage: 'de',
text: ['Take one tablet daily.'],
});textis an array, and the response has the same shape with the translated strings.
Run a chat session
Create a session with an assistant prompt, then send messages to it. send returns the reply.
await ovok.ai.chat.sessions.create({
assistant: { system: 'You answer questions about sleep.' },
participant: 'Patient/123',
messages: [],
});
// sessionId identifies a session you created or listed.
const reply = await ovok.ai.chat.messages.send(sessionId, {
sender: 'Patient/123',
content: 'Why do I wake up at night?',
});
const history = await ovok.ai.chat.messages.list(sessionId, { _sort: 'sent', _count: 20 });ovok.ai.chat.sessionshascreate,listandretrieve.retrieveacceptsmessageCountto include the latest messages.ovok.ai.chat.messageshaslistandsend.listcalls return the server's response envelope, not aPagePromise.
Search FHIR data in natural language
const answer = await ovok.ai.fhirSearch({ text: 'Latest blood pressure of Jane Doe' });
console.log(answer.markdown);- An LLM plans and runs the FHIR queries, so the answer can be wrong or invented. The response includes the
planthat was run so you can check it. fhirVersion: 'R4' | 'R5'pins the version; omitted, the server default applies.- For queries you control, use ovok.fhir.
Reference
- ai API reference: every method and type.
- ovok.fhir
- Errors and retries
Last updated on