conva_ai_core 0.1.1 conva_ai_core: ^0.1.1 copied to clipboard
This is the flutter plugin for using ConvaAI Core SDK
CONVA.ai from Slang Labs is the world's first Copilot-as-a-Service platform, that allows developers to easily add AI aUgmented eXperiences (AUX) inside their app with the least effort.
Initialization :
ConvaAI.init(id: "<AssistantID>", key: "<APIKey>", version: "<Version>");
Debugging responses : Conva AI uses generative AI to give you the response to your query. In order for you to understand the reasoning behind the response. We also provide you with AI's reasoning
Non-streaming capability completion call
try {
Response completion =
await ConvaAI.invokeCapability(input: "<input_query>");
print(completion)
} catch (error) {
print(error)
}
Streaming capability completion call
Stream<Response> completionStream =
ConvaAI.invokeCapabilityStream(
input: "<input_query>",
);
completionStream.listen(
(event) {
print(event)
},
onError: (error) {
print(error);
},
);
Use capability name
Capability names offer a direct way to invoke specific capabilities without the need to select them from capability groups. For targeted and efficient execution, developers can directly invoke a capability using its unique name. This is ideal when the desired capability is known beforehand.
Non-streaming capability with name completion call
try {
Response completion =
await ConvaAI.invokeCapabilityWithName(input: "<input_query>", capability: "<your_capability_name>");
print(completion)
} catch (error) {
print(error)
}
Streaming capability with name completion call
Stream<Response> completionStream =
ConvaAI.invokeCapabilityStream(
input: "<input_query>",
capability: "<your_capability_name>"
);
completionStream.listen(
(event) {
print(event)
},
onError: (error) {
print(error);
},
);
Use capability groups
Capability Groups are used to control the list of Capabilities that the Assistant will have access.
Non-streaming capability with group completion call
try {
Response completion =
await ConvaAI.invokeCapability(input: "<input_query>", capabilityGroup: "<your_capability_group>");
print(completion)
} catch (error) {
print(error)
}
Streaming capability with group completion call
Stream<Response> completionStream =
ConvaAI.invokeCapabilityStream(
input: "<input_query>",
capabilityGroup: "<CAPABILITY_GROUP_NAME>"
);
completionStream.listen(
(event) {
print(event)
},
onError: (error) {
print(error);
},
);
For other integration related information, please visit : https://docs.conva.ai/conva.ai-docs