Skip to content

Commit

Permalink
Update function name
Browse files Browse the repository at this point in the history
  • Loading branch information
congminh1254 committed Aug 26, 2024
1 parent 95dccd7 commit 366e5a1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion codegen/codegen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ import { generateManagerClasses } from './generate-manager-classes';
operationId: 'post_ai_text_gen',
},
{
name: 'getDefaultAiAgent',
name: 'getAiAgentDefaultConfig',
operationId: 'get_ai_agent_default',
}
]
Expand Down
4 changes: 2 additions & 2 deletions docs/ai.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ client.ai.textGen(
Get AI agent default configuration
------------------------

To get an AI agent default configuration call the [ai.getDefaultAiAgent(options?, callback?)](http://opensource.box.com/box-node-sdk/jsdoc/AIManager.html#getDefaultAiAgent) method. The `mode` parameter filters the agent configuration to be returned. It can be either `ask` or `text_gen`. The `language` parameter specifies the ISO language code to return the agent config for. If the language is not supported, the default agent configuration is returned. The `model` parameter specifies the model for which the default agent configuration should be returned.
To get an AI agent default configuration call the [ai.getAiAgentDefaultConfig(options?, callback?)](http://opensource.box.com/box-node-sdk/jsdoc/AIManager.html#getAiAgentDefaultConfig) method. The `mode` parameter filters the agent configuration to be returned. It can be either `ask` or `text_gen`. The `language` parameter specifies the ISO language code to return the agent config for. If the language is not supported, the default agent configuration is returned. The `model` parameter specifies the model for which the default agent configuration should be returned.

<!-- sample get_ai_agent_default -->
```js
client.ai.getDefaultAiAgent({
client.ai.getAiAgentDefaultConfig({
mode: 'ask',
language: 'en',
model:'openai__gpt_3_5_turbo'
Expand Down
2 changes: 1 addition & 1 deletion src/managers/ai.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class AIManager {
* @param {Function} [callback] Passed the result if successful, error otherwise
* @returns {Promise<schemas.AiAgentAsk | schemas.AiAgentTextGen>} A promise resolving to the result or rejecting with an error
*/
getDefaultAiAgent(
getAiAgentDefaultConfig(
options: {
/**
* The mode to filter the agent config to return.
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_test/__tests__/ai.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ test('test AI text gen', async() => {


test('test AI get default agent', async() => {
const agent = await context.client.ai.getDefaultAiAgent({
const agent = await context.client.ai.getAiAgentDefaultConfig({
mode: 'text_gen',
language: 'en',
model: 'openai__gpt_3_5_turbo'
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/managers/ai-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ describe('AI', function() {
});
});

describe('getDefaultAiAgent()', function() {
describe('getAiAgentDefaultConfig()', function() {
const agent = {
type: 'ai_agent_ask',
basic_text: {
Expand Down Expand Up @@ -236,7 +236,7 @@ describe('AI', function() {
.expects('get')
.withArgs('/ai_agent_default', expected_params)
.returns(Promise.resolve(agent));
return aimodule.getDefaultAiAgent({
return aimodule.getAiAgentDefaultConfig({
mode: 'ask',
language: 'en',
model: 'openai__gpt_3_5_turbo',
Expand Down

0 comments on commit 366e5a1

Please sign in to comment.