Skip to content

Commit 4d5df2c

Browse files
feat(api): api update
1 parent 204c363 commit 4d5df2c

6 files changed

Lines changed: 58 additions & 7 deletions

File tree

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 9
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/luma-ai-karanganesan%2Fluma_ai-77915e19d91e49806410e1f72c98350af91b90cc9757cc502214e532d51016fe.yml
3-
openapi_spec_hash: 5a8e2fe22b4400e78b88621090f145d8
1+
configured_endpoints: 10
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/luma-ai-karanganesan%2Fluma_ai-ab7a0e79cde55b79693fcafeb72a5f691be8fe87b60909f8fabf4823107ec2b7.yml
3+
openapi_spec_hash: 5e861f2431bafd7b34733b013e89a917
44
config_hash: 340ab81846cdf3a6dd774f425fd612aa

api.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ Methods:
1616

1717
## Concepts
1818

19+
Types:
20+
21+
- <code><a href="./src/resources/generations/concepts.ts">ConceptListResponse</a></code>
22+
23+
Methods:
24+
25+
- <code title="get /generations/concepts/list">client.generations.concepts.<a href="./src/resources/generations/concepts.ts">list</a>() -> ConceptListResponse</code>
26+
1927
## Image
2028

2129
Methods:
Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
import { APIResource } from '../../resource';
4+
import * as Core from '../../core';
45

5-
export class Concepts extends APIResource {}
6+
export class Concepts extends APIResource {
7+
/**
8+
* Get all possible concepts
9+
*/
10+
list(options?: Core.RequestOptions): Core.APIPromise<ConceptListResponse> {
11+
return this._client.get('/generations/concepts/list', options);
12+
}
13+
}
14+
15+
export type ConceptListResponse = Array<string>;
16+
17+
export declare namespace Concepts {
18+
export { type ConceptListResponse as ConceptListResponse };
19+
}

src/resources/generations/generations.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { APIResource } from '../../resource';
44
import { isRequestOptions } from '../../core';
55
import * as Core from '../../core';
66
import * as ConceptsAPI from './concepts';
7-
import { Concepts } from './concepts';
7+
import { ConceptListResponse, Concepts } from './concepts';
88
import * as ImageAPI from './image';
99
import { Image, ImageCreateParams } from './image';
1010
import * as VideoAPI from './video';
@@ -639,7 +639,7 @@ export declare namespace Generations {
639639
type GenerationUpscaleParams as GenerationUpscaleParams,
640640
};
641641

642-
export { Concepts as Concepts };
642+
export { Concepts as Concepts, type ConceptListResponse as ConceptListResponse };
643643

644644
export { Image as Image, type ImageCreateParams as ImageCreateParams };
645645

src/resources/generations/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
export { Concepts } from './concepts';
3+
export { Concepts, type ConceptListResponse } from './concepts';
44
export {
55
Generations,
66
type Generation,
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
import LumaAI from 'lumaai';
4+
import { Response } from 'node-fetch';
5+
6+
const client = new LumaAI({
7+
authToken: 'My Auth Token',
8+
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
9+
});
10+
11+
describe('resource concepts', () => {
12+
test('list', async () => {
13+
const responsePromise = client.generations.concepts.list();
14+
const rawResponse = await responsePromise.asResponse();
15+
expect(rawResponse).toBeInstanceOf(Response);
16+
const response = await responsePromise;
17+
expect(response).not.toBeInstanceOf(Response);
18+
const dataAndResponse = await responsePromise.withResponse();
19+
expect(dataAndResponse.data).toBe(response);
20+
expect(dataAndResponse.response).toBe(rawResponse);
21+
});
22+
23+
test('list: request options instead of params are passed correctly', async () => {
24+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
25+
await expect(client.generations.concepts.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
26+
LumaAI.NotFoundError,
27+
);
28+
});
29+
});

0 commit comments

Comments
 (0)