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.'],
});
  • text is 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.sessions has create, list and retrieve. retrieve accepts messageCount to include the latest messages.
  • ovok.ai.chat.messages has list and send.
  • list calls return the server's response envelope, not a PagePromise.

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 plan that 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

Last updated on

On this page