packages/tools/src/date.ts
Retrieves the current date in ISO format.
import { getCurrentDate } from '@fabrice-ai/tools/date'
const exampleAgent = agent({
role: '...',
description: '...',
tools: {
getCurrentDate,
},
})
packages/tools/src/webSearch.ts
Performs a Google search with a search query using the Serply API.
import { createWebSearchTools } from '@fabrice-ai/tools/webSearch'
const apiKey = 'your-serply-api-key'
const { googleSearch } = createWebSearchTools({ apiKey })
const exampleAgent = agent({
role: '...',
description: '...',
tools: {
googleSearch,
},
})
packages/tools/src/webSearch.ts
Performs a Google Image search with a search query using the Serply API.
import { createWebSearchTools } from '@fabrice-ai/tools/webSearch'
const apiKey = 'your-serply-api-key'
const { googleImageSearch } = createWebSearchTools({ apiKey })
const exampleAgent = agent({
role: '...',
description: '...',
tools: {
googleImageSearch,
},
})
packages/tools/src/firecrawl.ts
Scrapes a website using Firecrawl.dev to extract metadata and content.
import { createFireCrawlTool } from '@fabrice-ai/tools/firecrawl'
const exampleAgent = agent({
role: '...',
description: '...',
tools: {
createFireCrawlTool({
apiKey: 'Firecrawl API key ...'
}),
},
})
packages/tools/src/vector.ts
Save documents with embeddings, perform vector search.
import { createVectorStoreTools } from '@fabrice-ai/tools/vector'
const { saveDocumentInVectorStore, searchInVectorStore } = createVectorStoreTools()
const exampleAgent = agent({
role: '...',
description: '...',
tools: {
saveDocumentInVectorStore,
searchInVectorStore
},
})
import { createVectorStoreTools } from '@fabrice-ai/tools/vector'
/**
* createVectorStore accepts a `vectorStore` adapter.
* This is a way to switch the default - in-memory store to Pinecone or others of your choice.
*/
const createPineconeVectorStore = () => {
const store = new Map<string, EmbeddingResult>()
const set = async (id: string, value: EmbeddingResult): Promise<void> => {
// @tbd: implement storing document in Pinecone
}
const entries = async (): Promise<[string, EmbeddingResult][]> => {
// @tbd: implement searching documents in Pinecone
}
return {
set,
entries,
}
}
const { saveDocumentInVectorStore, searchInVectorStore } = createVectorStoreTools(createPineconeVectorStore())
const exampleAgent = agent({
role: '...',
description: '...',
tools: {
saveDocumentInVectorStore,
searchInVectorStore
},
})
packages/tools/src/vision.ts
Uses LLM as a OCR / Vision tool. Extract text or features from a picture.
import { visionTool } from '@fabrice-ai/tools/vision'
const exampleAgent = agent({
role: '...',
description: '...',
tools: {
visionTool
},
})
packages/tools/src/filesystem.ts
File system tools for reading, writing and listing files. The tools are sandboxed into workingDir
for safety.
import { createFileSystemTools } from '@fabrice-ai/tools/filesystem'
const workingDir = path.resolve(import.meta.dirname, '../assets/')
const { saveFile, readFile, listFilesFromDirectory } = createFileSystemTools({
workingDir,
})
const exampleAgent = agent({
role: '...',
description: '...',
tools: {
visionTool
},
})