Get AI agent default configuration

Guides Box AI Get AI agent default configuration
Edit this page

Get AI agent default configuration

Box AI Platform API is currently in beta which means the available capabilities may change. Box AI Platform API is available to all Enterprise Plus customers.

The GET /2.0/ai_agent_default endpoint allows you to fetch the default configuration for AI services. Once you get the configuration details, you can override them using the ai_agent parameter available in the POST /2.0/ai/ask and POST /2.0/ai/text_gen requests.

Override examples include:

  • Replacing the default LLM with a custom one based on your organization's needs.
  • Tweaking the base prompt to allow a more customized user experience.
  • Changing a parameter, such as temperature, to make the results more or less creative.

Send a request

To send a request, use the GET /2.0/ai_agent_default endpoint.

cURL
curl -L GET "https://api.box.com/2.0/ai_agent_default?mode=text_gen" \
     -H 'Authorization: Bearer <ACCESS_TOKEN>'
TypeScript Gen
await client.ai.getAiAgentDefaultConfig({
  mode: 'text_gen' as GetAiAgentDefaultConfigQueryParamsModeField,
  language: 'en-US',
} satisfies GetAiAgentDefaultConfigQueryParams);
Python Gen
client.ai.get_ai_agent_default_config(
    GetAiAgentDefaultConfigMode.TEXT_GEN.value, language="en-US"
)
.NET Gen
await client.Ai.GetAiAgentDefaultConfigAsync(queryParams: new GetAiAgentDefaultConfigQueryParams(mode: GetAiAgentDefaultConfigQueryParamsModeField.TextGen) { Language = "en-US" });
Swift Gen (Beta)
try await client.ai.getAiAgentDefaultConfig(queryParams: GetAiAgentDefaultConfigQueryParams(mode: GetAiAgentDefaultConfigQueryParamsModeField.textGen, language: "en-US"))
Java
BoxAIAgentConfig config = BoxAI.getAiAgentDefaultConfig(
    api,
    BoxAIAgent.Mode.ASK,
    "en",
    "openai__gpt_3_5_turbo"
);
Python
config = client.get_ai_agent_default_config(
    mode='text_gen',
    language='en',
    model='openai__gpt_3_5_turbo'
)
print(config)
Node
client.ai.getAiAgentDefaultConfig({
    mode: 'ask',
    language: 'en',
    model:'openai__gpt_3_5_turbo'
}).then(response => {
    /* response -> {
        "type": "ai_agent_ask",
        "basic_text": {
            "llm_endpoint_params": {
            "type": "openai_params",
            "frequency_penalty": 1.5,
            "presence_penalty": 1.5,
            "stop": "<|im_end|>",
            "temperature": 0,
            "top_p": 1
            },
            "model": "openai__gpt_3_5_turbo",
            "num_tokens_for_completion": 8400,
            "prompt_template": "It is `{current_date}`, and I have $8000 and want to spend a week in the Azores. What should I see?",
            "system_message": "You are a helpful travel assistant specialized in budget travel"
        },
        ...
    } */
});

Make sure you have generated the developer token to authorize your app. See prerequisites for using Box AI for details.

Parameters

To make a call, you must pass the following parameters. Mandatory parameters are in bold.

ParameterDescriptionExample
languageThe language code the agent configuration is returned for. If the language is not supported, the default configuration is returned.ja-JP
modeThe mode used to filter the agent configuration. The value can be ask or text_gen.ask
modelThe model you want to get the configuration for. To make sure your chosen model is supported, see the list of models.openai__gpt_3_5_turbo