@startinblox/ai-bridge 1.0.0 → 1.0.1

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 CHANGED
@@ -43,9 +43,9 @@ To perform an AI query, you can either use the `window.sibAIBridge.aiQuery` func
43
43
 
44
44
  ```typescript
45
45
  const result = await window.sibAIBridge.aiQuery(
46
- "your prompt here",
46
+ "3dobject-search", // or your custom model name
47
47
  [/* array of Resource objects */],
48
- "3dobjects" // or your custom model name
48
+ "your prompt here", // optional
49
49
  );
50
50
  console.log(result.datas); // Filtered resources
51
51
  ```
package/dist/index.js CHANGED
@@ -50572,8 +50572,9 @@ let yl = class extends QR {
50572
50572
  async init() {
50573
50573
  window.sibAIBridge || (window.sibAIBridge = {
50574
50574
  aiQuery: async (A, I, C) => ({
50575
- prompt: A,
50576
- datas: await this.applyModel(C, A, I)
50575
+ model: A,
50576
+ prompt: C,
50577
+ datas: await this.applyModel(A, C || "", I)
50577
50578
  })
50578
50579
  }), this.initializer?.(!0);
50579
50580
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startinblox/ai-bridge",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Startin'blox AI Bridge",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -55,10 +55,11 @@ export class SolidAIBridge extends LitElement {
55
55
 
56
56
  if (!window.sibAIBridge) {
57
57
  window.sibAIBridge = {
58
- aiQuery: async (prompt: string, datas: Resource[], model: string) => {
58
+ aiQuery: async (model: string, datas: Resource[], prompt?: string) => {
59
59
  return {
60
+ model,
60
61
  prompt,
61
- datas: await this.applyModel(model, prompt, datas),
62
+ datas: await this.applyModel(model, prompt || "", datas),
62
63
  };
63
64
  },
64
65
  };