-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add EchoAITool and turbo build pipeline
- Loading branch information
1 parent
336c758
commit a7647b8
Showing
14 changed files
with
121 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { EchoAITool } from '@agentic/core' | ||
import { describe, expect, test } from 'vitest' | ||
|
||
import { createAISDKTools } from './ai-sdk' | ||
|
||
describe('ai-sdk', () => { | ||
test('createAISDKTools', () => { | ||
expect(createAISDKTools(new EchoAITool())).toHaveProperty('echo') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import 'dotenv/config' | ||
|
||
import defaultKy, { | ||
type AfterResponseHook, | ||
type BeforeRequestHook, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { z } from 'zod' | ||
|
||
import { createAIFunction } from './create-ai-function' | ||
import { aiFunction, AIFunctionsProvider } from './fns' | ||
|
||
export class EchoAITool extends AIFunctionsProvider { | ||
@aiFunction({ | ||
name: 'echo', | ||
description: 'Echoes the input.', | ||
inputSchema: z.object({ | ||
query: z.string().describe('input query to echo') | ||
}) | ||
}) | ||
async echo({ query }: { query: string }) { | ||
return query | ||
} | ||
} | ||
|
||
export const echoAIFunction = createAIFunction( | ||
{ | ||
name: 'echo', | ||
description: 'Echoes the input.', | ||
inputSchema: z.object({ | ||
query: z.string().describe('input query to echo') | ||
}) | ||
}, | ||
({ query }: { query: string }) => { | ||
return query | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,37 @@ | ||
{ | ||
"$schema": "https://turbo.build/schema.json", | ||
"pipeline": { | ||
"ui": "stream", | ||
"tasks": { | ||
"build": { | ||
"dependsOn": ["^build"], | ||
"env": [ | ||
"ANTHROPIC_API_KEY", | ||
"AWS_REGION", | ||
"AWS_ACCESS_KEY_ID", | ||
"AWS_SECRET_ACCESS_KEY", | ||
"COHERE_API_KEY", | ||
"FIREWORKS_API_KEY", | ||
"GOOGLE_API_KEY", | ||
"GROQ_API_KEY", | ||
"HUGGINGFACE_API_KEY", | ||
"MISTRAL_API_KEY", | ||
"OPENAI_API_KEY", | ||
"OPENAI_API_BASE", | ||
"PERPLEXITY_API_KEY", | ||
"REPLICATE_API_KEY", | ||
"NODE_ENV", | ||
"ASSISTANT_ID", | ||
"INKEEP_API_KEY", | ||
"INKEEP_INTEGRATION_ID", | ||
"VERCEL_URL" | ||
], | ||
"outputs": ["dist/**"] | ||
}, | ||
"lint": { | ||
"dependsOn": ["^lint"] | ||
}, | ||
"type-check": { | ||
"dependsOn": ["^build", "build"] | ||
"clean": { | ||
"dependsOn": ["^clean"], | ||
"outputs": ["dist/**"] | ||
}, | ||
"test": { | ||
"dependsOn": ["^build", "build"] | ||
"dependsOn": [ | ||
"build", | ||
"test:format", | ||
"test:lint", | ||
"test:typecheck", | ||
"test:unit" | ||
] | ||
}, | ||
"publint": { | ||
"dependsOn": ["^build", "build"] | ||
"test:lint": { | ||
"dependsOn": ["^test:lint"] | ||
}, | ||
"clean": { | ||
"dependsOn": ["^clean"] | ||
"test:typecheck": { | ||
"dependsOn": ["^test:typecheck"] | ||
}, | ||
"test:unit": { | ||
"dependsOn": ["^test:unit"] | ||
}, | ||
"test:format": {}, | ||
"dev": { | ||
"cache": false, | ||
"persistent": true | ||
}, | ||
"prettier-check": {}, | ||
"integration-test": { | ||
"dependsOn": ["^build", "build"] | ||
} | ||
}, | ||
"globalEnv": ["CI", "PORT"] | ||
} | ||
} |