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 CHANGED
@@ -1 +1,5 @@
1
- export {};
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/dist/index.js CHANGED
@@ -1,37 +1,5 @@
1
- import { getClient } from "./lib/client.js";
2
- function add({ a, b }) {
3
- return a + b;
4
- }
5
- // Define the function tool for OpenAI
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smoltalk",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "A common interface for LLM APIs",
5
5
  "homepage": "https://github.com/egonSchiele/smoltalk",
6
6
  "scripts": {
@@ -1,4 +0,0 @@
1
- export * from "./client.js";
2
- export * from "./types.js";
3
- export * from "./models.js";
4
- export * from "./smolError.js";
package/dist/lib/index.js DELETED
@@ -1,4 +0,0 @@
1
- export * from "./client.js";
2
- export * from "./types.js";
3
- export * from "./models.js";
4
- export * from "./smolError.js";
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