oramacloud-client-kotlin
0.0.3indexedEnables interaction with Orama Cloud for executing full-text, vector, or hybrid searches and supports answer sessions with customizable parameters and event listeners.
Enables interaction with Orama Cloud for executing full-text, vector, or hybrid searches and supports answer sessions with customizable parameters and event listeners.
This repository contains Orama's Cloud Multiplatform Kotlin Client. Developers can use this library to interact with Orama using Kotlin in multiple plataforms,
To install, make sure to enable Maven repository and include the dependency in your build file gradle.build.kts.
repositories {
mavenCentral()
}
dependencies {
implementation "com.orama:oramasearch-client-kotlin:$OramaClientVersion"
}
Performing full-text, vector, or hybrid search:
First, you need to do is to instantiate the client passing your endpoint and apiKey.
After that, use the SearchParams to prepare you query.
Now, just call the client.search method with the parameters and a proper callback handler.
@Serializable
data class MyDoc (
val title: String,
val category: String,
val path: String,
val content: String,
val section: String
)
val client = OramaClient(
endpoint = "<ORAMA CLOUD URL>",
apiKey = "<ORAMA CLOUD API KEY>"
)
val searchParams = SearchParams.builder(
term = ,
mode = Mode.FULLTEXT
).build()
launch {
results = client.search(searchParams, MyDoc.serializer())
}
Performing an answer session:
val client = OramaClient(
endpoint = "<ORAMA CLOUD URL>",
apiKey = "<ORAMA CLOUD API KEY>"
)
val answerParams = AnswerParams(
userContext = null,
oramaClient = client,
inferenceType = InferenceType.DOCUMENTATION,
initialMessages = mutableListOf<Message>()
)
val answerSession = AnswerSession(
answerParams = answerParams,
events = : AnswerEventListener {
{
}
}
)
runBlocking {
answer = answerSession.ask(AskParams(
query =
))
println(answer)
}
Surfaced from shared tags and platforms — no rankings paid for.