smoltalk 0.0.2 → 0.0.3
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/dist/index.d.ts +5 -1
- package/dist/index.js +5 -37
- package/package.json +1 -1
- package/dist/lib/index.d.ts +0 -4
- package/dist/lib/index.js +0 -4
- package/dist/{lib/client.d.ts → client.d.ts} +0 -0
- package/dist/{lib/client.js → client.js} +1 -1
- /package/dist/{lib/clients → clients}/google.d.ts +0 -0
- /package/dist/{lib/clients → clients}/google.js +0 -0
- /package/dist/{lib/clients → clients}/openai.d.ts +0 -0
- /package/dist/{lib/clients → clients}/openai.js +0 -0
- /package/dist/{lib/models.d.ts → models.d.ts} +0 -0
- /package/dist/{lib/models.js → models.js} +0 -0
- /package/dist/{lib/smolError.d.ts → smolError.d.ts} +0 -0
- /package/dist/{lib/smolError.js → smolError.js} +0 -0
- /package/dist/{lib/types → types}/result.d.ts +0 -0
- /package/dist/{lib/types → types}/result.js +0 -0
- /package/dist/{lib/types.d.ts → types.d.ts} +0 -0
- /package/dist/{lib/types.js → types.js} +0 -0
- /package/dist/{lib/util → util}/openai.d.ts +0 -0
- /package/dist/{lib/util → util}/openai.js +0 -0
- /package/dist/{lib/util.d.ts → util.d.ts} +0 -0
- /package/dist/{lib/util.js → util.js} +0 -0
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,37 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const addTool = {
|
|
7
|
-
type: "function",
|
|
8
|
-
function: {
|
|
9
|
-
name: "add",
|
|
10
|
-
description: "Adds two numbers together and returns the result.",
|
|
11
|
-
parameters: {
|
|
12
|
-
type: "object",
|
|
13
|
-
properties: {
|
|
14
|
-
a: {
|
|
15
|
-
type: "number",
|
|
16
|
-
description: "The first number to add",
|
|
17
|
-
},
|
|
18
|
-
b: {
|
|
19
|
-
type: "number",
|
|
20
|
-
description: "The second number to add",
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
required: ["a", "b"],
|
|
24
|
-
additionalProperties: false,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
const client = getClient({
|
|
29
|
-
apiKey: process.env.OPENAI_API_KEY || "",
|
|
30
|
-
logLevel: "debug",
|
|
31
|
-
model: "gpt-4o-mini",
|
|
32
|
-
});
|
|
33
|
-
async function main() {
|
|
34
|
-
const resp = await client.text("add 2 + 2", { tools: [addTool] });
|
|
35
|
-
console.log(resp);
|
|
36
|
-
}
|
|
37
|
-
main();
|
|
1
|
+
export * from "./client.js";
|
|
2
|
+
export * from "./types.js";
|
|
3
|
+
export * from "./models.js";
|
|
4
|
+
export * from "./smolError.js";
|
|
5
|
+
export * from "./util.js";
|
package/package.json
CHANGED
package/dist/lib/index.d.ts
DELETED
package/dist/lib/index.js
DELETED
|
File without changes
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export * from "./clients/google.js";
|
|
2
2
|
export * from "./clients/openai.js";
|
|
3
|
+
import { EgonLog } from "egonlog";
|
|
3
4
|
import { SmolGoogle } from "./clients/google.js";
|
|
4
5
|
import { SmolOpenAi } from "./clients/openai.js";
|
|
5
6
|
import { getModel, isTextModel } from "./models.js";
|
|
6
7
|
import { SmolError } from "./smolError.js";
|
|
7
|
-
import { EgonLog } from "egonlog";
|
|
8
8
|
export function getClient(config) {
|
|
9
9
|
const apiKey = config.apiKey;
|
|
10
10
|
const logger = new EgonLog({ level: config.logLevel || "info" });
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|