@chat-ads/chatads-sdk 0.1.5 → 0.1.6
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 +2 -2
- package/dist/models.d.ts +3 -3
- package/package.json +1 -1
- package/dist/examples/basic.d.ts +0 -1
- package/dist/examples/basic.js +0 -22
package/README.md
CHANGED
|
@@ -41,7 +41,7 @@ if (response.success && response.data?.ad) {
|
|
|
41
41
|
```ts
|
|
42
42
|
const result = await client.analyzeMessage("Need scheduling ideas", {
|
|
43
43
|
country: "US",
|
|
44
|
-
message_analysis: "
|
|
44
|
+
message_analysis: "thorough",
|
|
45
45
|
});
|
|
46
46
|
```
|
|
47
47
|
|
|
@@ -106,7 +106,7 @@ try {
|
|
|
106
106
|
"meta": {
|
|
107
107
|
"request_id": "req_123",
|
|
108
108
|
"extraction_method": "llm",
|
|
109
|
-
"message_analysis_used": "
|
|
109
|
+
"message_analysis_used": "thorough",
|
|
110
110
|
"fill_priority_used": "coverage",
|
|
111
111
|
"min_intent_used": "low",
|
|
112
112
|
"processing_time_ms": 42.3,
|
package/dist/models.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type MessageAnalysis = "fast" | "
|
|
1
|
+
export type MessageAnalysis = "fast" | "thorough";
|
|
2
2
|
export type FillPriority = "speed" | "coverage";
|
|
3
3
|
export type MinIntent = "any" | "low" | "medium" | "high";
|
|
4
4
|
/**
|
|
@@ -10,7 +10,7 @@ export type FunctionItemOptionalFields = {
|
|
|
10
10
|
ip?: string;
|
|
11
11
|
/** ISO 3166-1 alpha-2 country code for geo-targeting */
|
|
12
12
|
country?: string;
|
|
13
|
-
/** Keyword extraction method. Default: "
|
|
13
|
+
/** Keyword extraction method. Default: "thorough" */
|
|
14
14
|
message_analysis?: MessageAnalysis;
|
|
15
15
|
/** URL resolution fallback behavior. Default: "coverage" */
|
|
16
16
|
fill_priority?: FillPriority;
|
|
@@ -58,7 +58,7 @@ export interface ChatAdsMeta {
|
|
|
58
58
|
country?: string | null;
|
|
59
59
|
language?: string | null;
|
|
60
60
|
extraction_method?: "llm" | "nlp" | "skip" | null;
|
|
61
|
-
message_analysis_used?: "fast" | "
|
|
61
|
+
message_analysis_used?: "fast" | "thorough" | "skip" | null;
|
|
62
62
|
fill_priority_used?: "speed" | "coverage" | "skip" | null;
|
|
63
63
|
min_intent_used?: "any" | "low" | "medium" | "high" | null;
|
|
64
64
|
processing_time_ms?: number | null;
|
package/package.json
CHANGED
package/dist/examples/basic.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/examples/basic.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ChatAdsClient } from "@chat-ads/chatads-sdk";
|
|
2
|
-
async function main() {
|
|
3
|
-
const apiKey = process.env.CHATADS_API_KEY;
|
|
4
|
-
if (!apiKey) {
|
|
5
|
-
throw new Error("CHATADS_API_KEY env var is required");
|
|
6
|
-
}
|
|
7
|
-
const client = new ChatAdsClient({
|
|
8
|
-
apiKey,
|
|
9
|
-
baseUrl: process.env.CHATADS_BASE_URL ?? "https://chatads--chatads-api-fastapiserver-serve.modal.run",
|
|
10
|
-
maxRetries: 1,
|
|
11
|
-
raiseOnFailure: true,
|
|
12
|
-
});
|
|
13
|
-
const response = await client.analyze({
|
|
14
|
-
message: "A great home gym always includes a yoga mat",
|
|
15
|
-
ip: "",
|
|
16
|
-
});
|
|
17
|
-
console.log(JSON.stringify(response, null, 2));
|
|
18
|
-
}
|
|
19
|
-
main().catch((error) => {
|
|
20
|
-
console.error(error);
|
|
21
|
-
process.exit(1);
|
|
22
|
-
});
|