For more authentication options, see: https://doc.rapida.ai/api-reference/authentication
Parameters
ConnectionConfig
required
Configuration for the client connection.
GetAssistantKnowledgeRequest
required
Usage
from rapida import (
ConnectionConfig,
GetAssistantKnowledgeRequest,
get_assistant_knowledge,
)
from pprint import pprint
connection_config = ConnectionConfig.default_connection_config(
ConnectionConfig.with_sdk("{rapida-api-key}")
)
response = get_assistant_knowledge(
client_cfg=connection_config,
request=GetAssistantKnowledgeRequest(
id="{assistant_knowledge_id}", assistantId="{assistant_id}"
),
)
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 assistant knowledge configuration
response, err := clients.GetAssistantKnowledge(context.Background(), connectionConfig, &rapida_proto.GetAssistantKnowledgeRequest{
AssistantId: 3456789876541212,
Id: 567898765456788765,
})
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,
GetAssistantKnowledge,
GetAssistantKnowledgeRequest,
} from "@rapidaai/nodejs";
(async () => {
const connectionCfg = ConnectionConfig.DefaultConnectionConfig(
ConnectionConfig.WithSDK({
ApiKey: process.env.RAPIDA_PROJECT_CREDENTIAL,
})
);
getAssistantKnowledge(connectionCfg, 45678903456789, 12345676543211);
})();
async function getAssistantKnowledge(connectionCfg, assistantId, knowledgeId) {
const request = new GetAssistantKnowledgeRequest();
request.setAssistantId(assistantId);
request.setId(knowledgeId);
try {
const response = await GetAssistantKnowledge(connectionCfg, request);
console.log("Assistant Knowledge Response:", response.toObject());
} catch (error) {
console.error("Error with GetAssistantKnowledge call:", error);
}
}
Response
int32
Numeric status code for the operation.
boolean
Indicates whether the operation was successful.
AssistantKnowledge
Detailed information about the assistant’s knowledge configuration.
Show child attributes
Show child attributes
uint64
Unique identifier for the assistant knowledge configuration.
uint64
Identifier of the associated knowledge base.
boolean
Whether the reranker is enabled for knowledge retrieval.
uint32
Maximum number of top results to retrieve from the knowledge base.
float32
Minimum similarity score threshold for knowledge retrieval.
Knowledge
Detailed information about the associated 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.
string
Visibility setting of the knowledge base.
string
Language of the knowledge base content.
uint64
Identifier of the embedding model provider.
string
Name of the embedding model provider.
Metadata[]
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
Total number of documents in the knowledge base.
uint32
Total number of tokens in the knowledge base.
uint32
Total number of words in the knowledge base.
string
Method used for retrieving knowledge from the knowledge base.
uint64
Identifier of the reranker model provider.
string
Name of the reranker model provider.
Metadata[]
timestamp
Timestamp when the assistant knowledge configuration was created.
timestamp
Timestamp when the assistant knowledge configuration was last updated.
string
Current status of the assistant knowledge configuration.