AiResource
Calls the Ovok AI routes under /ai.
- Stable unknown
- Release candidate since 0.1.0-rc.4
- Development since 0.1.0-dev.24+fa54770
public final class AiResourceCalls the Ovok AI routes under /ai. Get it from Ovok.ai().
Methods
chat
public AiResource.ChatResource chat()Returns the AI chat sessions and messages.
Returns: the chat resource
translate
public JsonNode translate(Object body) throws IOException, InterruptedExceptionTranslates text (POST /ai/translation).
Parameters:
body: the translation request
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public JsonNode translate(
Object body,
RequestOptions options) throws IOException, InterruptedExceptionTranslates text (POST /ai/translation).
Parameters:
body: the translation requestoptions: per-request options, such as the timeout
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
fhirSearch
public JsonNode fhirSearch(Object body) throws IOException, InterruptedExceptionTurns a natural-language question into a FHIR search (POST /ai/fhir/search).
Parameters:
body: the search request
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public JsonNode fhirSearch(
Object body,
RequestOptions options) throws IOException, InterruptedExceptionTurns a natural-language question into a FHIR search (POST /ai/fhir/search).
Parameters:
body: the search requestoptions: per-request options, such as the timeout
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
AiResource.ChatResource
public static final class ChatResourceAI chat sessions and their messages. Get it from AiResource.chat().
ChatResource.sessions
public AiResource.SessionsResource sessions()Returns the chat sessions.
Returns: the sessions resource
ChatResource.messages
public AiResource.MessagesResource messages()Returns the chat messages.
Returns: the messages resource
AiResource.SessionsResource
public static final class SessionsResourceAI chat sessions under /ai/session. Get it from ChatResource.sessions().
SessionsResource.create
public JsonNode create(Object body) throws IOException, InterruptedExceptionStarts a chat session (POST /ai/session).
Parameters:
body: the session to create
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public JsonNode create(Object body, RequestOptions options) throws IOException, InterruptedExceptionStarts a chat session (POST /ai/session).
Parameters:
body: the session to createoptions: per-request options, such as the timeout
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
SessionsResource.list
public JsonNode list(Map<String, ?> parameters) throws IOException, InterruptedExceptionLists chat sessions (GET /ai/session).
Parameters:
parameters: query parameters
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public JsonNode list() throws IOException, InterruptedExceptionLists chat sessions (GET /ai/session).
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public JsonNode list(
Map<String, ?> parameters,
RequestOptions options) throws IOException, InterruptedExceptionLists chat sessions (GET /ai/session).
Parameters:
parameters: query parametersoptions: per-request options, such as the timeout
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
SessionsResource.retrieve
public JsonNode retrieve(String sessionId) throws IOException, InterruptedExceptionReads a chat session (GET /ai/session/{id}).
Parameters:
sessionId: the session ID
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public JsonNode retrieve(
String sessionId,
Map<String, ?> parameters) throws IOException, InterruptedExceptionReads a chat session (GET /ai/session/{id}).
Parameters:
sessionId: the session IDparameters: query parameters
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public JsonNode retrieve(
String sessionId,
Map<String, ?> parameters,
RequestOptions options) throws IOException, InterruptedExceptionReads a chat session (GET /ai/session/{id}).
Parameters:
sessionId: the session IDparameters: query parametersoptions: per-request options, such as the timeout
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
AiResource.MessagesResource
public static final class MessagesResourceMessages in an AI chat session. Get it from ChatResource.messages().
MessagesResource.list
public JsonNode list(
String sessionId,
Map<String, ?> parameters) throws IOException, InterruptedExceptionLists a session's messages (GET /ai/session/{id}/message).
Parameters:
sessionId: the session IDparameters: query parameters
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public JsonNode list(
String sessionId,
Map<String, ?> parameters,
RequestOptions options) throws IOException, InterruptedExceptionLists a session's messages (GET /ai/session/{id}/message).
Parameters:
sessionId: the session IDparameters: query parametersoptions: per-request options, such as the timeout
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
MessagesResource.send
public JsonNode send(String sessionId, Object body) throws IOException, InterruptedExceptionSends a message to a session (POST /ai/session/{id}/message).
Parameters:
sessionId: the session IDbody: the message
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public JsonNode send(
String sessionId,
Object body,
RequestOptions options) throws IOException, InterruptedExceptionSends a message to a session (POST /ai/session/{id}/message).
Parameters:
sessionId: the session IDbody: the messageoptions: per-request options, such as the timeout
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
Last updated on