samsar-js 0.48.13 → 0.48.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -93,7 +93,10 @@ const cancelled = await samsar.cancelRender({
|
|
|
93
93
|
console.log(cancelled.data.status, cancelled.data.cancelled);
|
|
94
94
|
|
|
95
95
|
// Enhance chat message
|
|
96
|
-
const enhanced = await samsar.enhanceMessage({
|
|
96
|
+
const enhanced = await samsar.enhanceMessage({
|
|
97
|
+
message: 'Please improve this caption.',
|
|
98
|
+
maxwords: 450,
|
|
99
|
+
});
|
|
97
100
|
|
|
98
101
|
// Set an account-level assistant system prompt
|
|
99
102
|
await samsar.setAssistantSystemPrompt({
|
|
@@ -214,7 +217,9 @@ const replaced = await samsar.replaceBrandingFromImage({
|
|
|
214
217
|
// Extend image set
|
|
215
218
|
const images = await samsar.extendImageList({
|
|
216
219
|
image_urls: ['https://example.com/extra.jpg'],
|
|
220
|
+
prompt: 'Create a cinematic travel header banner',
|
|
217
221
|
num_images: 4,
|
|
222
|
+
aspect_ratio: '16:9',
|
|
218
223
|
});
|
|
219
224
|
|
|
220
225
|
// Create a reusable receipt template from one sample receipt image (free endpoint)
|
package/dist/index.d.ts
CHANGED
|
@@ -292,6 +292,8 @@ export interface EnhanceMessageRequest {
|
|
|
292
292
|
message: string;
|
|
293
293
|
metadata?: Record<string, unknown>;
|
|
294
294
|
language?: string;
|
|
295
|
+
maxwords?: number | string;
|
|
296
|
+
maxWords?: number | string;
|
|
295
297
|
}
|
|
296
298
|
export interface EnhanceMessageResponse {
|
|
297
299
|
content: string;
|
|
@@ -686,6 +688,7 @@ export interface ExtendImageListRequest {
|
|
|
686
688
|
num_images: number;
|
|
687
689
|
prompt?: string;
|
|
688
690
|
metadata?: Record<string, unknown>;
|
|
691
|
+
aspect_ratio?: string;
|
|
689
692
|
}
|
|
690
693
|
export interface ExtendImageListResponse {
|
|
691
694
|
status?: string;
|
|
@@ -698,6 +701,7 @@ export interface ExtendImageListResponse {
|
|
|
698
701
|
metadata?: Record<string, unknown>;
|
|
699
702
|
prompt?: string;
|
|
700
703
|
num_images?: number;
|
|
704
|
+
aspect_ratio?: string;
|
|
701
705
|
userId?: string;
|
|
702
706
|
creditsCharged?: number;
|
|
703
707
|
remainingCredits?: number;
|
|
@@ -1436,6 +1440,7 @@ export declare class SamsarClient {
|
|
|
1436
1440
|
/**
|
|
1437
1441
|
* Enhance or rewrite text using the chat enhancement endpoint.
|
|
1438
1442
|
* Optionally pass `language` (code or name) to enforce the output language.
|
|
1443
|
+
* Pass `maxwords` (or `maxWords`) as a positive integer to override the default output limit.
|
|
1439
1444
|
*/
|
|
1440
1445
|
enhanceMessage(payload: EnhanceMessageRequest, options?: SamsarRequestOptions): Promise<SamsarResult<EnhanceMessageResponse>>;
|
|
1441
1446
|
/**
|
package/dist/index.js
CHANGED
|
@@ -611,6 +611,7 @@ export class SamsarClient {
|
|
|
611
611
|
/**
|
|
612
612
|
* Enhance or rewrite text using the chat enhancement endpoint.
|
|
613
613
|
* Optionally pass `language` (code or name) to enforce the output language.
|
|
614
|
+
* Pass `maxwords` (or `maxWords`) as a positive integer to override the default output limit.
|
|
614
615
|
*/
|
|
615
616
|
async enhanceMessage(payload, options) {
|
|
616
617
|
return this.post('chat/enhance', payload, options);
|