Skip to main content
Retrieves detailed information about a specific assistant’s knowledge configuration using the Rapida API.
For more authentication options, see: https://doc.rapida.ai/api-reference/authentication

Parameters

connectionConfig
ConnectionConfig
required
Configuration for the client connection.
request
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

code
int32
Numeric status code for the operation.
success
boolean
Indicates whether the operation was successful.
data
AssistantKnowledge
Detailed information about the assistant’s knowledge configuration.
error
object
Error information, if applicable.