Get AI agent default configuration
Get AI agent default configuration
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 -L GET "https://api.box.com/2.0/ai_agent_default?mode=text_gen" \
-H 'Authorization: Bearer <ACCESS_TOKEN>'
await client.ai.getAiAgentDefaultConfig({
mode: 'text_gen' as GetAiAgentDefaultConfigQueryParamsModeField,
language: 'en-US',
} satisfies GetAiAgentDefaultConfigQueryParams);
client.ai.get_ai_agent_default_config(
GetAiAgentDefaultConfigMode.EXTRACT_STRUCTURED.value, language="en-US"
)
await client.Ai.GetAiAgentDefaultConfigAsync(queryParams: new GetAiAgentDefaultConfigQueryParams(mode: GetAiAgentDefaultConfigQueryParamsModeField.TextGen) { Language = "en-US" });
BoxAIAgentConfig config = BoxAI.getAiAgentDefaultConfig(
api,
BoxAIAgent.Mode.ASK,
"en",
"openai__gpt_3_5_turbo"
);
config = client.get_ai_agent_default_config(
mode='text_gen',
language='en',
model='openai__gpt_3_5_turbo'
)
print(config)
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.
Parameter | Description | Example |
---|---|---|
language | The language code the agent configuration is returned for. If the language is not supported, the default configuration is returned. | ja-JP |
mode | The mode used to filter the agent configuration. The value can be ask or text_gen . | ask |
model | The 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 |