Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monorepo refactor into separate packages #657

Merged
merged 22 commits into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"privatePackages": false,
"updateInternalDependencies": "patch",
"ignore": []
}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ node_modules

# next.js
.next/
out/

# production
build/
Expand All @@ -29,6 +28,9 @@ yarn-error.log*
# local env files
.env*.local

# turbo
.turbo

# vercel
.vercel

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async function main() {
console.log(browserTool.parameters)

const result = await generateText({
model: openai('gpt-4o'),
model: openai('gpt-4o-mini'),
tools: { browserTool },
toolChoice: 'required',
temperature: 0,
Expand Down
6 changes: 3 additions & 3 deletions examples/ai-sdk/weather.ts → examples/ai-sdk/bin/weather.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/usr/bin/env node
import 'dotenv/config'

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

async function main() {
const weather = new WeatherClient()

const result = await generateText({
model: openai('gpt-4o'),
model: openai('gpt-4o-mini'),
tools: createAISDKTools(weather),
toolChoice: 'required',
temperature: 0,
Expand Down
23 changes: 23 additions & 0 deletions examples/ai-sdk/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "agentic-examples-ai-sdk",
"type": "module",
"private": true,
"scripts": {
"test": "run-s test:*",
"test:lint": "eslint .",
"test:typecheck": "tsc --noEmit"
},
"dependencies": {
"@agentic/ai-sdk": "workspace:*",
"@agentic/core": "workspace:*",
"@agentic/weather": "workspace:*",
"@ai-sdk/openai": "^0.0.24",
"@browserbasehq/sdk": "^1.4.2",
"ai": "^3.1.30",
"openai": "^4.49.0",
"zod": "^3.23.8"
},
"devDependencies": {
"@agentic/tsconfig": "workspace:*"
}
}
5 changes: 5 additions & 0 deletions examples/ai-sdk/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": "@agentic/tsconfig/base.json",
"include": ["bin"],
"exclude": ["node_modules", "dist"]
}
5 changes: 3 additions & 2 deletions examples/dexter/analyze.ts → examples/dexter/bin/analyze.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
#!/usr/bin/env node
import 'dotenv/config'

import { createDexterFunctions } from '@agentic/dexter'
import { DiffbotClient, SearchAndCrawl, SerpAPIClient } from '@agentic/stdlib'
import { createDexterFunctions } from '@agentic/stdlib/dexter'
import { ChatModel, createAIRunner } from '@dexaai/dexter'

async function main() {
const serpapi = new SerpAPIClient()
const diffbot = new DiffbotClient()

const searchAndCrawl = new SearchAndCrawl({ serpapi, diffbot })

const runner = createAIRunner({
chatModel: new ChatModel({
params: { model: 'gpt-4o', temperature: 0 }
params: { model: 'gpt-4o-mini', temperature: 0 }
// debug: true
}),
functions: createDexterFunctions(searchAndCrawl),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/usr/bin/env node
import 'dotenv/config'

import { createDexterFunctions } from '@agentic/stdlib/dexter'
import { e2b } from '@agentic/stdlib/e2b'
import { createDexterFunctions } from '@agentic/dexter'
import { e2b } from '@agentic/e2b'
import { ChatModel, createAIRunner } from '@dexaai/dexter'

async function main() {
const runner = createAIRunner({
chatModel: new ChatModel({
params: { model: 'gpt-4o', temperature: 0 },
params: { model: 'gpt-4o-mini', temperature: 0 },
debug: true
}),
functions: createDexterFunctions(e2b)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
#!/usr/bin/env node
import 'dotenv/config'

import {
createAIChain,
Msg,
PerigonClient,
SerperClient
} from '@agentic/stdlib'
import { createAIChain, Msg } from '@agentic/core'
import { PerigonClient } from '@agentic/perigon'
import { SerperClient } from '@agentic/serper'
import { ChatModel } from '@dexaai/dexter'

async function main() {
const perigon = new PerigonClient()
const serper = new SerperClient()

const chatModel = new ChatModel({
params: { model: 'gpt-4o', temperature: 0 },
params: { model: 'gpt-4o-mini', temperature: 0 },
debug: true
})

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env node
import 'dotenv/config'

import { PerigonClient, SerperClient } from '@agentic/stdlib'
import { createDexterFunctions } from '@agentic/stdlib/dexter'
import { createDexterFunctions } from '@agentic/dexter'
import { PerigonClient } from '@agentic/perigon'
import { SerperClient } from '@agentic/serper'
import { ChatModel, createAIRunner } from '@dexaai/dexter'

async function main() {
Expand All @@ -11,7 +12,7 @@ async function main() {

const runner = createAIRunner({
chatModel: new ChatModel({
params: { model: 'gpt-4o', temperature: 0 }
params: { model: 'gpt-4o-mini', temperature: 0 }
// debug: true
}),
functions: createDexterFunctions(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node
import 'dotenv/config'

import { extractObject, Msg } from '@agentic/stdlib'
import { extractObject, Msg } from '@agentic/core'
import { ChatModel } from '@dexaai/dexter'
import { z } from 'zod'

Expand Down
6 changes: 3 additions & 3 deletions examples/dexter/weather.ts → examples/dexter/bin/weather.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/usr/bin/env node
import 'dotenv/config'

import { WeatherClient } from '@agentic/stdlib'
import { createDexterFunctions } from '@agentic/stdlib/dexter'
import { createDexterFunctions } from '@agentic/dexter'
import { WeatherClient } from '@agentic/weather'
import { ChatModel, createAIRunner } from '@dexaai/dexter'

async function main() {
const weather = new WeatherClient()

const runner = createAIRunner({
chatModel: new ChatModel({
params: { model: 'gpt-4o', temperature: 0 }
params: { model: 'gpt-4o-mini', temperature: 0 }
// debug: true
}),
functions: createDexterFunctions(weather),
Expand Down
24 changes: 24 additions & 0 deletions examples/dexter/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "agentic-examples-dexter",
"type": "module",
"private": true,
"scripts": {
"test": "run-s test:*",
"test:lint": "eslint .",
"test:typecheck": "tsc --noEmit"
},
"dependencies": {
"@agentic/core": "workspace:*",
"@agentic/dexter": "workspace:*",
"@agentic/e2b": "workspace:*",
"@agentic/perigon": "workspace:*",
"@agentic/serper": "workspace:*",
"@agentic/stdlib": "workspace:*",
"@agentic/weather": "workspace:*",
"@dexaai/dexter": "^2.1.0",
"zod": "^3.23.8"
},
"devDependencies": {
"@agentic/tsconfig": "workspace:*"
}
}
5 changes: 5 additions & 0 deletions examples/dexter/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": "@agentic/tsconfig/base.json",
"include": ["bin"],
"exclude": ["node_modules", "dist"]
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env node
import 'dotenv/config'

import { createGenkitTools } from '@agentic/genkit'
import { WeatherClient } from '@agentic/stdlib'
import { createGenkitTools } from '@agentic/stdlib/genkit'
import { generate } from '@genkit-ai/ai'
import { configureGenkit } from '@genkit-ai/core'
import { gpt4o, openAI } from 'genkitx-openai'
Expand Down
22 changes: 22 additions & 0 deletions examples/genkit/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "agentic-examples-genkit",
"type": "module",
"private": true,
"scripts": {
"test": "run-s test:*",
"test:lint": "eslint .",
"test:typecheck": "tsc --noEmit"
},
"dependencies": {
"@agentic/core": "workspace:*",
"@agentic/genkit": "workspace:*",
"@agentic/stdlib": "workspace:*",
"@genkit-ai/ai": "^0.5.9",
"@genkit-ai/core": "^0.5.9",
"genkitx-openai": "^0.10.0",
"zod": "^3.23.8"
},
"devDependencies": {
"@agentic/tsconfig": "workspace:*"
}
}
5 changes: 5 additions & 0 deletions examples/genkit/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": "@agentic/tsconfig/base.json",
"include": ["bin"],
"exclude": ["node_modules", "dist"]
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env node
import 'dotenv/config'

import { createLangChainTools } from '@agentic/langchain'
import { WeatherClient } from '@agentic/stdlib'
import { createLangChainTools } from '@agentic/stdlib/langchain'
import { ChatPromptTemplate } from '@langchain/core/prompts'
import { ChatOpenAI } from '@langchain/openai'
import { AgentExecutor, createToolCallingAgent } from 'langchain/agents'
Expand All @@ -12,7 +12,7 @@ async function main() {

const tools = createLangChainTools(weather)
const agent = createToolCallingAgent({
llm: new ChatOpenAI({ model: 'gpt-4o', temperature: 0 }),
llm: new ChatOpenAI({ model: 'gpt-4o-mini', temperature: 0 }),
tools,
prompt: ChatPromptTemplate.fromMessages([
['system', 'You are a helpful assistant. Be as concise as possible.'],
Expand Down
22 changes: 22 additions & 0 deletions examples/langchain/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "agentic-examples-langchain",
"type": "module",
"private": true,
"scripts": {
"test": "run-s test:*",
"test:lint": "eslint .",
"test:typecheck": "tsc --noEmit"
},
"dependencies": {
"@agentic/core": "workspace:*",
"@agentic/langchain": "workspace:*",
"@agentic/stdlib": "workspace:*",
"@langchain/core": "^0.2.20",
"@langchain/openai": "^0.2.5",
"langchain": "^0.2.12",
"zod": "^3.23.8"
},
"devDependencies": {
"@agentic/tsconfig": "workspace:*"
}
}
5 changes: 5 additions & 0 deletions examples/langchain/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": "@agentic/tsconfig/base.json",
"include": ["bin"],
"exclude": ["node_modules", "dist"]
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/usr/bin/env node
import 'dotenv/config'

import { createLlamaIndexTools } from '@agentic/llamaindex'
import { WeatherClient } from '@agentic/stdlib'
import { createLlamaIndexTools } from '@agentic/stdlib/llamaindex'
import { OpenAI, OpenAIAgent } from 'llamaindex'

async function main() {
const weather = new WeatherClient()

const tools = createLlamaIndexTools(weather)
const agent = new OpenAIAgent({
llm: new OpenAI({ model: 'gpt-4o', temperature: 0 }),
llm: new OpenAI({ model: 'gpt-4o-mini', temperature: 0 }),
systemPrompt: 'You are a helpful assistant. Be as concise as possible.',
tools
})
Expand All @@ -19,7 +19,7 @@ async function main() {
message: 'What is the weather in San Francisco?'
})

console.log(response.response.message.content)
console.log(response.message.content)
}

await main()
20 changes: 20 additions & 0 deletions examples/llamaindex/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "agentic-examples-llamaindex",
"type": "module",
"private": true,
"scripts": {
"test": "run-s test:*",
"test:lint": "eslint .",
"test:typecheck": "tsc --noEmit"
},
"dependencies": {
"@agentic/core": "workspace:*",
"@agentic/llamaindex": "workspace:*",
"@agentic/stdlib": "workspace:*",
"llamaindex": "^0.5.13",
"zod": "^3.23.8"
},
"devDependencies": {
"@agentic/tsconfig": "workspace:*"
}
}
5 changes: 5 additions & 0 deletions examples/llamaindex/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": "@agentic/tsconfig/base.json",
"include": ["bin"],
"exclude": ["node_modules", "dist"]
}
Loading
Loading