Skip to content

Commit

Permalink
feat: update core deps and third-party frameworks
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit committed Oct 21, 2024
1 parent 27599b7 commit b7bc0e9
Show file tree
Hide file tree
Showing 19 changed files with 2,628 additions and 4,113 deletions.
3 changes: 2 additions & 1 deletion examples/ai-sdk/bin/browserbase.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/usr/bin/env node
import 'dotenv/config'

import { openai } from '@ai-sdk/openai'
import { createOpenAI } from '@ai-sdk/openai'
import { Browserbase, BrowserbaseAISDK } from '@browserbasehq/sdk'
import { generateText } from 'ai'

async function main() {
const browserbase = new Browserbase()
const openai = createOpenAI({ compatibility: 'strict' })

const browserTool = BrowserbaseAISDK(browserbase, { textContent: true })
console.log(browserTool.parameters)
Expand Down
3 changes: 2 additions & 1 deletion examples/ai-sdk/bin/weather.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import 'dotenv/config'

import { createAISDKTools } from '@agentic/ai-sdk'
import { WeatherClient } from '@agentic/weather'
import { openai } from '@ai-sdk/openai'
import { createOpenAI } from '@ai-sdk/openai'
import { generateText } from 'ai'

async function main() {
const weather = new WeatherClient()
const openai = createOpenAI({ compatibility: 'strict' })

const result = await generateText({
model: openai('gpt-4o-mini'),
Expand Down
4 changes: 2 additions & 2 deletions examples/ai-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"@agentic/ai-sdk": "workspace:*",
"@agentic/core": "workspace:*",
"@agentic/weather": "workspace:*",
"@ai-sdk/openai": "^0.0.24",
"@ai-sdk/openai": "^0.0.68",
"@browserbasehq/sdk": "^1.4.2",
"ai": "^3.1.30",
"ai": "^3.4.16",
"openai": "^4.49.0",
"zod": "^3.23.8"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/genkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"@agentic/core": "workspace:*",
"@agentic/genkit": "workspace:*",
"@agentic/stdlib": "workspace:*",
"@genkit-ai/ai": "^0.5.9",
"@genkit-ai/core": "^0.5.9",
"@genkit-ai/ai": "^0.5.16",
"@genkit-ai/core": "^0.5.16",
"genkitx-openai": "^0.10.0",
"zod": "^3.23.8"
},
Expand Down
6 changes: 3 additions & 3 deletions examples/langchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"@agentic/core": "workspace:*",
"@agentic/langchain": "workspace:*",
"@agentic/stdlib": "workspace:*",
"@langchain/core": "^0.2.20",
"@langchain/openai": "^0.2.5",
"langchain": "^0.2.12",
"@langchain/core": "^0.3.13",
"@langchain/openai": "^0.3.11",
"langchain": "^0.3.3",
"zod": "^3.23.8"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/llamaindex/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@agentic/core": "workspace:*",
"@agentic/llamaindex": "workspace:*",
"@agentic/stdlib": "workspace:*",
"llamaindex": "^0.5.13",
"llamaindex": "^0.7.3",
"zod": "^3.23.8"
},
"devDependencies": {
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@
"prepare": "husky"
},
"devDependencies": {
"@changesets/cli": "^2.27.7",
"@changesets/cli": "^2.27.9",
"@fisch0920/eslint-config": "^1.4.0",
"@total-typescript/ts-reset": "^0.5.1",
"@types/node": "^22.4.0",
"del-cli": "^5.1.0",
"@total-typescript/ts-reset": "^0.6.1",
"@types/node": "^22.7.6",
"del-cli": "^6.0.0",
"dotenv": "^16.4.5",
"eslint": "^8.57.0",
"husky": "^9.1.4",
"lint-staged": "^15.2.9",
"npm-run-all2": "^6.2.2",
"eslint": "^8.57.1",
"husky": "^9.1.6",
"lint-staged": "^15.2.10",
"npm-run-all2": "^6.2.4",
"only-allow": "^1.2.1",
"prettier": "^3.3.3",
"tsup": "^8.2.4",
"tsx": "^4.17.0",
"turbo": "^2.0.14",
"typescript": "^5.5.4",
"vitest": "2.0.5",
"tsup": "^8.3.0",
"tsx": "^4.19.1",
"turbo": "^2.2.0",
"typescript": "^5.6.3",
"vitest": "2.1.3",
"zod": "^3.23.8"
},
"lint-staged": {
Expand Down
1 change: 0 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"test:unit": "vitest run"
},
"dependencies": {
"@sindresorhus/is": "^7.0.0",
"dedent": "^1.5.3",
"delay": "^6.0.0",
"hash-object": "^5.0.1",
Expand Down
26 changes: 5 additions & 21 deletions packages/core/src/assert.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { isError } from '@sindresorhus/is'

function assertImpl(value: unknown, message?: string | Error): asserts value {
export function assert(
value: unknown,
message?: string | Error
): asserts value {
if (value) {
return
}
Expand All @@ -9,22 +10,5 @@ function assertImpl(value: unknown, message?: string | Error): asserts value {
throw new Error('Assertion failed')
}

throw isError(message) ? message : new Error(message)
throw typeof message === 'string' ? new Error(message) : message
}

/**
* Assertion function that defaults to Node.js's `assert` module if it's
* available, with a basic backup if not.
*/
let assert: (value: unknown, message?: string | Error) => asserts value =
assertImpl

try {
// Default to the Node.js assert module if it's available
const assertImport = await import('node:assert')
if (assertImport?.default) {
assert = assertImport.default
}
} catch {}

export { assert }
2 changes: 1 addition & 1 deletion packages/core/src/extract-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ export function extractObject<Result extends types.AIChainResult = string>(
args: ExtractObjectParams<Result>
): Promise<Result> {
const chain = createAIChain(args)
return chain()
return chain() as Promise<Result>
}
4 changes: 2 additions & 2 deletions packages/e2b/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
},
"peerDependencies": {
"@agentic/core": "workspace:*",
"@e2b/code-interpreter": "^0.0.8",
"@e2b/code-interpreter": "^1.0.2",
"zod": "^3.23.8"
},
"devDependencies": {
"@agentic/core": "workspace:*",
"@agentic/tsconfig": "workspace:*",
"@e2b/code-interpreter": "^0.0.8"
"@e2b/code-interpreter": "^1.0.2"
},
"publishConfig": {
"access": "public"
Expand Down
12 changes: 6 additions & 6 deletions packages/e2b/src/e2b.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createAIFunction, getEnv } from '@agentic/core'
import { CodeInterpreter, type ProcessMessage } from '@e2b/code-interpreter'
import { Sandbox } from '@e2b/code-interpreter'
import { z } from 'zod'

/**
Expand All @@ -26,17 +26,17 @@ Execute python code in a Jupyter notebook cell and returns any result, stdout, s
})
},
async ({ code }) => {
const sandbox = await CodeInterpreter.create({
const sandbox = await Sandbox.create({
apiKey: getEnv('E2B_API_KEY')
})

try {
const exec = await sandbox.notebook.execCell(code, {
onStderr: (msg: ProcessMessage) => {
const exec = await sandbox.runCode(code, {
onStderr: (msg) => {
console.warn('[Code Interpreter stderr]', msg)
},

onStdout: (stdout: ProcessMessage) => {
onStdout: (stdout) => {
console.log('[Code Interpreter stdout]', stdout)
}
})
Expand All @@ -48,7 +48,7 @@ Execute python code in a Jupyter notebook cell and returns any result, stdout, s

return exec.results.map((result) => result.toJSON())
} finally {
await sandbox.close()
await sandbox.kill()
}
}
)
3 changes: 3 additions & 0 deletions packages/e2b/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"extends": "@agentic/tsconfig/base.json",
"compilerOptions": {
"noImplicitAny": false
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
}
4 changes: 2 additions & 2 deletions packages/genkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
},
"peerDependencies": {
"@agentic/core": "workspace:*",
"@genkit-ai/ai": "^0.5.9"
"@genkit-ai/ai": "^0.5.16"
},
"devDependencies": {
"@agentic/core": "workspace:*",
"@agentic/tsconfig": "workspace:*",
"@genkit-ai/ai": "^0.5.9"
"@genkit-ai/ai": "^0.5.16"
},
"publishConfig": {
"access": "public"
Expand Down
11 changes: 11 additions & 0 deletions packages/genkit/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig } from 'vitest/config'

export default defineConfig({
test: {
server: {
deps: {
inline: true
}
}
}
})
4 changes: 2 additions & 2 deletions packages/langchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
},
"peerDependencies": {
"@agentic/core": "workspace:*",
"@langchain/core": "^0.2.20"
"@langchain/core": "^0.3.13"
},
"devDependencies": {
"@agentic/core": "workspace:*",
"@agentic/tsconfig": "workspace:*",
"@langchain/core": "^0.2.20"
"@langchain/core": "^0.3.13"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions packages/llamaindex/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
},
"peerDependencies": {
"@agentic/core": "workspace:*",
"llamaindex": "^0.5.13"
"llamaindex": "^0.7.3"
},
"devDependencies": {
"@agentic/core": "workspace:*",
"@agentic/tsconfig": "workspace:*",
"llamaindex": "^0.5.13"
"llamaindex": "^0.7.3"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/stdlib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"@agentic/wikidata": "workspace:*",
"@agentic/wikipedia": "workspace:*",
"@agentic/wolfram-alpha": "workspace:*",
"@e2b/code-interpreter": "^0.0.8"
"@e2b/code-interpreter": "^1.0.2"
},
"peerDependencies": {
"@agentic/core": "workspace:*",
Expand Down
Loading

0 comments on commit b7bc0e9

Please sign in to comment.