For more authentication options, see: https://doc.rapida.ai/api-reference/authentication
Parameters
ConnectionConfig
required
Configuration for the client connection.
GetAllAssistantKnowledgeRequest
required
Show child attributes
Show child attributes
uint64
required
The unique identifier of the assistant whose knowledge bases to retrieve.
Paginate
Usage
from rapida import (
ConnectionConfig,
GetAllAssistantKnowledgeRequest,
get_all_assistant_knowledge,
)
from pprint import pprint
connection_config = ConnectionConfig.default_connection_config(
ConnectionConfig.with_sdk("{rapida-api-key}")
)
response = get_all_assistant_knowledge(
client_cfg=connection_config,
request=GetAllAssistantKnowledgeRequest(
assistantId="{assistant_id}",
paginate=Paginate(page=0, pageSize=20),
# criterias=[Criteria(key="KEY", value="VALUE", logic="should")],
),
)
pprint(response)
import (
"context"
"fmt"
"os"
clients "github.com/rapidaai/rapida-go/rapida/clients"
rapida_proto "github.com/rapidaai/rapida-go/rapida/clients/protos"
connections "github.com/rapidaai/rapida-go/rapida/connections"
)
func main() {
// Configure client connection using RAPIDA_PROJECT_CREDENTIAL environment variable
connectionConfig := connections.
DefaultconnectionConfig(connections.WithSDK(os.Getenv("RAPIDA_PROJECT_CREDENTIAL")))
// Retrieve all knowledge bases for an assistant
response, err := clients.GetAllAssistantKnowledge(context.Background(), connectionConfig, &rapida_proto.GetAllAssistantKnowledgeRequest{
AssistantId: 3456789876541212,
Paginate: &rapida_proto.Paginate{
Page: 0,
PageSize: 20,
},
// Optional: Add search criteria
// Criterias: []*rapida_proto.Criteria{{
// Key: "status",
// Value: "active",
// Logic: "must",
// }},
})
if err != nil {
fmt.Printf("Error while making call using rapida: %+v\n", err)
return
}
// Print the response
fmt.Printf("Rapida calling response: %+v\n", response)
}
import {
ConnectionConfig,
Paginate,
GetAllAssistantKnowledge,
GetAllAssistantKnowledgeRequest,
} from "@rapidaai/nodejs";
(async () => {
const connectionCfg = ConnectionConfig.DefaultConnectionConfig(
ConnectionConfig.WithSDK({
ApiKey: process.env.RAPIDA_PROJECT_CREDENTIAL,
})
);
getAllAssistantKnowledge(connectionCfg, 56789678987890121, 0, 20);
})();
async function getAllAssistantKnowledge(connectionCfg, assistantId, page = 0, pageSize = 20) {
const pagination = new Paginate();
pagination.setPage(page);
pagination.setPageSize(pageSize);
const request = new GetAllAssistantKnowledgeRequest();
request.setAssistantId(assistantId);
request.setPaginate(pagination);
try {
const response = await GetAllAssistantKnowledge(connectionCfg, request);
console.log("All Assistant Knowledge Response:", response.toObject());
} catch (error) {
console.error("Error with GetAllAssistantKnowledge call:", error);
}
}
Response
int32
Numeric status code for the operation.
boolean
Indicates whether the operation was successful.
AssistantKnowledge[]
Array of assistant knowledge configurations.
Show child attributes
Show child attributes
uint64
Unique identifier for the assistant knowledge mapping.
uint64
Identifier of the associated knowledge base.
boolean
Whether reranking is enabled for this knowledge base.
uint32
Number of top results to retrieve from the knowledge base.
float32
Minimum similarity score threshold for results.
Knowledge
Detailed information about the knowledge base.
Show child attributes
Show child attributes
uint64
Unique identifier for the knowledge base.
string
Name of the knowledge base.
string
Description of the knowledge base purpose.
string
Visibility setting of the knowledge base.
string
Language setting for the knowledge base.
uint64
Identifier of the embedding model provider.
string
Name of the embedding model provider.
Metadata[]
Array of embedding model configuration options.
string
Current status of the knowledge base.
uint64
Identifier of the knowledge base creator.
User
User object of the knowledge base creator.
uint64
Identifier of the last updater.
User
User object of the last updater.
timestamp
Timestamp when the knowledge base was created.
timestamp
Timestamp when the knowledge base was last updated.
uint64
Associated organization identifier.
uint64
Associated project identifier.
Organization
Organization details associated with the knowledge base.
Tag
Tag information associated with the knowledge base.
uint32
Number of documents in the knowledge base.
uint32
Total token count in the knowledge base.
uint32
Total word count in the knowledge base.
string
Method used for retrieving information from the knowledge base.
uint64
Identifier of the reranker model provider.
string
Name of the reranker model provider.
Metadata[]
Array of reranker configuration options.
timestamp
Timestamp when the assistant knowledge mapping was created.
timestamp
Timestamp when the assistant knowledge mapping was last updated.
string
Current status of the assistant knowledge mapping.
object