### Setup and Run Example Source: https://github.com/code/lib-agentic/blob/main/docs/sdks/xsai.mdx Steps to clone the repository, install dependencies, set up environment variables, and run the xsAI weather example. ```sh git clone git@github.com:transitive-bullshit/agentic.git cd agentic pnpm install echo 'WEATHER_API_KEY=your-key' >> .env echo 'OPENAI_API_KEY=your-key' >> .env npx tsx examples/xsai/bin/weather.ts ``` -------------------------------- ### Setup and Run LlamaIndex Example Source: https://github.com/code/lib-agentic/blob/main/docs/sdks/llamaindex.mdx Instructions for cloning the repository, installing dependencies, setting API keys in a `.env` file, and running the weather example. ```bash git clone git@github.com:transitive-bullshit/agentic.git cd agentic pnpm install echo 'WEATHER_API_KEY=your-key' >> .env echo 'OPENAI_API_KEY=your-key' >> .env npx tsx examples/llamaindex/bin/weather.ts ``` -------------------------------- ### Setup and Run Genkit Example Source: https://github.com/code/lib-agentic/blob/main/docs/sdks/genkit.mdx Instructions for cloning the repository, installing dependencies, setting environment variables for API keys, and running the Genkit weather example. ```bash git clone git@github.com:transitive-bullshit/agentic.git cd agentic pnpm install echo 'WEATHER_API_KEY=your-key' >> .env echo 'OPENAI_API_KEY=your-key' >> .env npx tsx examples/genkit/bin/weather.ts ``` -------------------------------- ### Setup and Run OpenAI Example Source: https://github.com/code/lib-agentic/blob/main/docs/sdks/openai.mdx Clone the repository, install dependencies, set API keys in .env, and run the weather example using tsx. ```bash git clone git@github.com:transitive-bullshit/agentic.git cd agentic pnpm install echo 'WEATHER_API_KEY=your-key' >> .env echo 'OPENAI_API_KEY=your-key' >> .env npx tsx examples/openai/bin/weather.ts ``` -------------------------------- ### Setup and Run Example Source: https://github.com/code/lib-agentic/blob/main/docs/sdks/ai-sdk.mdx Clone the agentic repository, install dependencies, set up API keys in a .env file, and run the example using tsx. ```sh git clone git@github.com:transitive-bullshit/agentic.git cd agentic pnpm install echo 'WEATHER_API_KEY=your-key' >> .env echo 'OPENAI_API_KEY=your-key' >> .env npx tsx examples/ai-sdk/bin/weather.ts ``` -------------------------------- ### Setup and Run LangChain Example Source: https://github.com/code/lib-agentic/blob/main/docs/sdks/langchain.mdx Clone the agentic repository, install dependencies, set your API keys in a `.env` file, and run the LangChain weather example using tsx. ```bash git clone git@github.com:transitive-bullshit/agentic.git cd agentic pnpm install echo 'WEATHER_API_KEY=your-key' >> .env echo 'OPENAI_API_KEY=your-key' >> .env npx tsx examples/langchain/bin/weather.ts ``` -------------------------------- ### Setup and Run OpenAI Responses API Example Source: https://github.com/code/lib-agentic/blob/main/docs/sdks/openai.mdx Clone the Agentic repository, install dependencies, configure your .env file with API keys, and execute the weather responses example. ```bash git clone git@github.com:transitive-bullshit/agentic.git cd agentic pnpm install echo 'WEATHER_API_KEY=your-key' >> .env echo 'OPENAI_API_KEY=your-key' >> .env npx tsx examples/openai/bin/weather-responses.ts ``` -------------------------------- ### Setup and Run Mastra Weather Agent Example Source: https://github.com/code/lib-agentic/blob/main/docs/sdks/mastra.mdx Clone the repository, install dependencies, set API keys in a .env file, and run the Mastra weather agent example using tsx. ```bash git clone git@github.com:transitive-bullshit/agentic.git cd agentic pnpm install echo 'WEATHER_API_KEY=your-key' >> .env echo 'OPENAI_API_KEY=your-key' >> .env npx tsx examples/mastra/bin/weather.ts ``` -------------------------------- ### Running the Dexter Example Source: https://github.com/code/lib-agentic/blob/main/docs/sdks/dexter.mdx Clone the repository, install dependencies, set your API keys in a `.env` file, and run the example script using `npx tsx`. ```bash git clone git@github.com:transitive-bullshit/agentic.git cd agentic pnpm install echo 'WEATHER_API_KEY=your-key' >> .env echo 'OPENAI_API_KEY=your-key' >> .env npx tsx examples/dexter/bin/weather.ts ``` -------------------------------- ### Usage Example: Genkit with OpenAI and Weather Client Source: https://github.com/code/lib-agentic/blob/main/docs/sdks/genkit.mdx This example demonstrates setting up Genkit with OpenAI, creating a WeatherClient, and generating a response to a weather query. Ensure you have installed `genkitx-openai` and configured API keys. ```typescript import 'dotenv/config' import { createGenkitTools } from '@agentic/genkit' import { WeatherClient } from '@agentic/stdlib' import { genkit } from 'genkit' import { gpt4oMini, openAI } from 'genkitx-openai' async function main() { const weather = new WeatherClient() const ai = genkit({ plugins: [openAI()] }) const result = await ai.generate({ model: gpt4oMini, tools: createGenkitTools(ai, weather), system: 'You are a helpful assistant. Be as concise as possible.', prompt: 'What is the weather in San Francisco?' }) console.log(result) } await main() ``` -------------------------------- ### Run GenAIScript Calculator Example Source: https://github.com/code/lib-agentic/blob/main/docs/sdks/genaiscript.mdx Clone the repository, install dependencies, set your OpenAI API key, and run the calculator example using GenAIScript. ```bash git clone git@github.com:transitive-bullshit/agentic.git cd agentic pnpm install echo 'OPENAI_API_KEY=your-key' >> .env npx genaiscript examples/genaiscript/calculator.genai.mts ``` -------------------------------- ### Install AI SDK Dependencies Source: https://github.com/code/lib-agentic/blob/main/docs/sdks/ai-sdk.mdx Install the necessary packages for the AI SDK example, including the OpenAI provider, Agentic weather tool, and dotenv for environment variables. ```bash npm install @ai-sdk/openai @agentic/weather dotenv ``` ```bash yarn add @ai-sdk/openai @agentic/weather dotenv ``` ```bash pnpm add @ai-sdk/openai @agentic/weather dotenv ``` -------------------------------- ### Create and use MCP tools with an AI SDK Source: https://github.com/code/lib-agentic/blob/main/docs/tools/mcp.mdx This example demonstrates how to create an MCP tools provider, which starts a local MCP server process using stdio transport. It then integrates these tools with an AI SDK (OpenAI's GPT-4o mini) to generate text based on available filesystem tools. ```typescript import 'dotenv/config' import { createAISDKTools } from '@agentic/ai-sdk' import { createMcpTools } from '@agentic/mcp' import { openai } from '@ai-sdk/openai' import { generateText } from 'ai' async function main() { // Create an MCP tools provider, which will start a local MCP server process // and use the stdio transport to communicate with it. const mcpTools = await createMcpTools({ name: 'agentic-mcp-filesystem', serverProcess: { command: 'npx', args: [ '-y', // This example uses a built-in example MCP server from Anthropic, which // provides a set of tools to access the local filesystem. '@modelcontextprotocol/server-filesystem', // Allow the MCP server to access the current working directory. process.cwd() // Feel free to add additional directories the tool should have access to. ] } }) const result = await generateText({ model: openai('gpt-4o-mini'), tools: createAISDKTools(mcpTools), toolChoice: 'required', temperature: 0, system: 'You are a helpful assistant. Be as concise as possible.', prompt: 'What files are in the current directory?' }) console.log(result.toolResults[0]) } await main() ``` -------------------------------- ### Usage Example: xsAI with Weather Client Source: https://github.com/code/lib-agentic/blob/main/docs/sdks/xsai.mdx Demonstrates how to use `createXSAITools` with a `WeatherClient` to generate text. Note that `createXSAITools` is async. Requires `dotenv` and `@agentic/weather` to be installed. ```typescript import 'dotenv/config' import { WeatherClient } from '@agentic/weather' import { createXSAITools } from '@agentic/xsai' import { generateText } from 'xsai' async function main() { const weather = new WeatherClient() const result = await generateText({ apiKey: process.env.OPENAI_API_KEY!, baseURL: 'https://api.openai.com/v1/', model: 'gpt-4o-mini', tools: await createXSAITools(weather), toolChoice: 'required', temperature: 0, messages: [ { role: 'system', content: 'You are a helpful assistant. Be as concise as possible.' }, { role: 'user', content: 'What is the weather in San Francisco?' } ] }) console.log(JSON.stringify(result, null, 2)) } await main() ``` -------------------------------- ### Install Agentic Weather Tool and Dotenv with yarn Source: https://github.com/code/lib-agentic/blob/main/docs/sdks/xsai.mdx Install the Agentic weather tool and dotenv for the usage example using yarn. ```bash yarn add @agentic/weather dotenv ``` -------------------------------- ### Install Agentic Weather Tool and Dotenv with npm Source: https://github.com/code/lib-agentic/blob/main/docs/sdks/xsai.mdx Install the Agentic weather tool and dotenv for the usage example using npm. ```bash npm install @agentic/weather dotenv ``` -------------------------------- ### Install Agentic Weather Tool and Dotenv with pnpm Source: https://github.com/code/lib-agentic/blob/main/docs/sdks/xsai.mdx Install the Agentic weather tool and dotenv for the usage example using pnpm. ```bash pnpm add @agentic/weather dotenv ``` -------------------------------- ### Install @agentic/youtube with pnpm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/youtube.mdx Install the package using pnpm. ```bash pnpm add @agentic/youtube ``` -------------------------------- ### Install @agentic/leadmagic with yarn Source: https://github.com/code/lib-agentic/blob/main/docs/tools/leadmagic.mdx Install the LeadMagic package using yarn. ```bash yarn add @agentic/leadmagic ``` -------------------------------- ### Install @agentic/exa with npm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/exa.mdx Install the Exa client library using npm. ```bash npm install @agentic/exa ``` -------------------------------- ### Install @agentic/zoominfo Source: https://github.com/code/lib-agentic/blob/main/docs/tools/zoominfo.mdx Install the ZoomInfo package using your preferred package manager. ```bash npm install @agentic/zoominfo ``` ```bash yarn add @agentic/zoominfo ``` ```bash pnpm add @agentic/zoominfo ``` -------------------------------- ### Install @agentic/clearbit with pnpm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/clearbit.mdx Install the Clearbit package using pnpm. ```bash pnpm add @agentic/clearbit ``` -------------------------------- ### Install @agentic/youtube with yarn Source: https://github.com/code/lib-agentic/blob/main/docs/tools/youtube.mdx Install the package using yarn. ```bash yarn add @agentic/youtube ``` -------------------------------- ### Install @agentic/youtube with npm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/youtube.mdx Install the package using npm. ```bash npm install @agentic/youtube ``` -------------------------------- ### Install @agentic/clearbit with npm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/clearbit.mdx Install the Clearbit package using npm. ```bash npm install @agentic/clearbit ``` -------------------------------- ### Install @agentic/google-docs with npm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/google-docs.mdx Install the package and its dependencies using npm. ```bash npm install @agentic/google-docs googleapis @google-cloud/local-auth ``` -------------------------------- ### Install @agentic/exa with pnpm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/exa.mdx Install the Exa client library using pnpm. ```bash pnpm add @agentic/exa ``` -------------------------------- ### Install @agentic/clearbit with yarn Source: https://github.com/code/lib-agentic/blob/main/docs/tools/clearbit.mdx Install the Clearbit package using yarn. ```bash yarn add @agentic/clearbit ``` -------------------------------- ### Install @agentic/exa with yarn Source: https://github.com/code/lib-agentic/blob/main/docs/tools/exa.mdx Install the Exa client library using yarn. ```bash yarn add @agentic/exa ``` -------------------------------- ### Install @agentic/slack Source: https://github.com/code/lib-agentic/blob/main/docs/tools/slack.mdx Install the package using npm, yarn, or pnpm. ```bash npm install @agentic/slack ``` ```bash yarn add @agentic/slack ``` ```bash pnpm add @agentic/slack ``` -------------------------------- ### Install @agentic/predict-leads with yarn Source: https://github.com/code/lib-agentic/blob/main/docs/tools/predict-leads.mdx Install the package using yarn. ```bash yarn add @agentic/predict-leads ``` -------------------------------- ### Install @agentic/leadmagic with npm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/leadmagic.mdx Install the LeadMagic package using npm. ```bash npm install @agentic/leadmagic ``` -------------------------------- ### Install @agentic/predict-leads with pnpm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/predict-leads.mdx Install the package using pnpm. ```bash pnpm add @agentic/predict-leads ``` -------------------------------- ### Install @agentic/wikidata with pnpm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/wikidata.mdx Install the package using pnpm. ```bash pnpm add @agentic/wikidata ``` -------------------------------- ### Install @agentic/serpapi with npm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/serpapi.mdx Install the SerpAPI client package using npm. ```bash npm install @agentic/serpapi ``` -------------------------------- ### Install @agentic/predict-leads with npm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/predict-leads.mdx Install the package using npm. ```bash npm install @agentic/predict-leads ``` -------------------------------- ### Install @agentic/wikidata with npm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/wikidata.mdx Install the package using npm. ```bash npm install @agentic/wikidata ``` -------------------------------- ### Install @agentic/serpapi with yarn Source: https://github.com/code/lib-agentic/blob/main/docs/tools/serpapi.mdx Install the SerpAPI client package using yarn. ```bash yarn add @agentic/serpapi ``` -------------------------------- ### Install @agentic/leadmagic with pnpm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/leadmagic.mdx Install the LeadMagic package using pnpm. ```bash pnpm add @agentic/leadmagic ``` -------------------------------- ### Install @agentic/google-docs with pnpm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/google-docs.mdx Install the package and its dependencies using pnpm. ```bash pnpm add @agentic/google-docs googleapis @google-cloud/local-auth ``` -------------------------------- ### Install @agentic/searxng with pnpm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/searxng.mdx Install the SearxngClient package using pnpm. ```bash pnpm add @agentic/searxng ``` -------------------------------- ### Install @agentic/serpapi with pnpm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/serpapi.mdx Install the SerpAPI client package using pnpm. ```bash pnpm add @agentic/serpapi ``` -------------------------------- ### Install Brave Search with yarn Source: https://github.com/code/lib-agentic/blob/main/docs/tools/brave-search.mdx Install the @agentic/brave-search package using yarn. ```bash yarn add @agentic/brave-search ``` -------------------------------- ### Install @agentic/serper with yarn Source: https://github.com/code/lib-agentic/blob/main/docs/tools/serper.mdx Install the Serper client package using yarn. ```bash yarn add @agentic/serper ``` -------------------------------- ### Install @agentic/jina with yarn Source: https://github.com/code/lib-agentic/blob/main/docs/tools/jina.mdx Install the Jina client package using yarn. ```bash yarn add @agentic/jina ``` -------------------------------- ### Install @agentic/searxng with yarn Source: https://github.com/code/lib-agentic/blob/main/docs/tools/searxng.mdx Install the SearxngClient package using yarn. ```bash yarn add @agentic/searxng ``` -------------------------------- ### Install @agentic/searxng with npm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/searxng.mdx Install the SearxngClient package using npm. ```bash npm install @agentic/searxng ``` -------------------------------- ### Install @agentic/serper with pnpm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/serper.mdx Install the Serper client package using pnpm. ```bash pnpm add @agentic/serper ``` -------------------------------- ### Install @agentic/jina with npm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/jina.mdx Install the Jina client package using npm. ```bash npm install @agentic/jina ``` -------------------------------- ### Install @agentic/jina with pnpm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/jina.mdx Install the Jina client package using pnpm. ```bash pnpm add @agentic/jina ``` -------------------------------- ### Install @agentic/serper with npm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/serper.mdx Install the Serper client package using npm. ```bash npm install @agentic/serper ``` -------------------------------- ### Install Brave Search with npm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/brave-search.mdx Install the @agentic/brave-search package using npm. ```bash npm install @agentic/brave-search ``` -------------------------------- ### Create and Run a LangChain Agent with Tools Source: https://github.com/code/lib-agentic/blob/main/docs/sdks/langchain.mdx This example demonstrates how to create LangChain tools from an existing client, define an agent using a tool-calling language model, and execute the agent with an input. Ensure your OpenAI and weatherapi.com API keys are set in a `.env` file. ```typescript import { createLangChainTools } from '@agentic/langchain' import { WeatherClient } from '@agentic/stdlib' import { ChatPromptTemplate } from '@langchain/core/prompts' import { ChatOpenAI } from '@langchain/openai' import { AgentExecutor, createToolCallingAgent } from 'langchain/agents' async function main() { const weather = new WeatherClient() const tools = createLangChainTools(weather) const agent = createToolCallingAgent({ llm: new ChatOpenAI({ model: 'gpt-4o-mini', temperature: 0 }), tools, prompt: ChatPromptTemplate.fromMessages([ ['system', 'You are a helpful assistant. Be as concise as possible.'], ['placeholder', '{chat_history}'], ['human', '{input}'], ['placeholder', '{agent_scratchpad}'] ]) }) const agentExecutor = new AgentExecutor({ agent, tools // verbose: true }) const result = await agentExecutor.invoke({ input: 'What is the weather in San Francisco?' }) console.log(result.output) } await main() ``` -------------------------------- ### Install Wolfram Alpha Client (npm) Source: https://github.com/code/lib-agentic/blob/main/docs/tools/wolfram-alpha.mdx Install the `@agentic/wolfram-alpha` package using npm. ```bash npm install @agentic/wolfram-alpha ``` -------------------------------- ### Install Wolfram Alpha Client (pnpm) Source: https://github.com/code/lib-agentic/blob/main/docs/tools/wolfram-alpha.mdx Install the `@agentic/wolfram-alpha` package using pnpm. ```bash pnpm add @agentic/wolfram-alpha ``` -------------------------------- ### Search Wikipedia and Get Page Summaries with WikipediaClient Source: https://context7.com/code/lib-agentic/llms.txt Use the WikipediaClient to search for articles and retrieve summaries. No API key is required. Install with `npm install @agentic/wikipedia`. ```typescript import { WikipediaClient } from '@agentic/wikipedia' // npm install @agentic/wikipedia const wikipedia = new WikipediaClient() // Search articles const searchResults = await wikipedia.search({ query: 'artificial intelligence' }) console.log(searchResults.pages[0].title) // => "Artificial intelligence" // Get page summary const summary = await wikipedia.getPageSummary({ title: 'TypeScript' }) console.log(summary.title) // => "TypeScript" console.log(summary.extract) // => "TypeScript is a free and open-source..." ``` -------------------------------- ### Install Wolfram Alpha Client (yarn) Source: https://github.com/code/lib-agentic/blob/main/docs/tools/wolfram-alpha.mdx Install the `@agentic/wolfram-alpha` package using yarn. ```bash yarn add @agentic/wolfram-alpha ``` -------------------------------- ### Authenticate and Get Google Document Source: https://github.com/code/lib-agentic/blob/main/docs/tools/google-docs.mdx Example of authenticating with Google Cloud and fetching a read-only Google Document using the `GoogleDocsClient`. Ensure the `GOOGLE_CREDENTIALS_PATH` environment variable is set. ```typescript import { GoogleDriveClient } from '@agentic/google-drive' import { authenticate } from '@google-cloud/local-auth' import { google } from 'googleapis' // (in a real app, store these auth credentials and reuse them) const auth = await authenticate({ scopes: ['https://www.googleapis.com/auth/documents.readonly'], keyfilePath: process.env.GOOGLE_CREDENTIALS_PATH }) const docs = google.docs({ version: 'v1', auth }) const client = new GoogleDocsClient({ docs }) const document = await client.getDocument({ documentId: 'TODO' }) console.log(document) ``` -------------------------------- ### Install @agentic/open-meteo Source: https://github.com/code/lib-agentic/blob/main/docs/tools/open-meteo.mdx Install the Open-Meteo client library using npm, yarn, or pnpm. ```bash npm install @agentic/open-meteo ``` ```bash yarn add @agentic/open-meteo ``` ```bash pnpm add @agentic/open-meteo ``` -------------------------------- ### Generate Client with Global Install Source: https://github.com/code/lib-agentic/blob/main/packages/openapi-to-ts/readme.md Install the tool globally via npm and then use the command-line interface to generate a TypeScript client. ```bash npm install -g @agentic/openapi-to-ts openapi-to-ts fixtures/openapi/3.0/notion.json -o fixtures/generated ``` -------------------------------- ### Initialize YouTubeClient and Search Videos Source: https://github.com/code/lib-agentic/blob/main/docs/tools/youtube.mdx Import and initialize the YouTubeClient, then use it to search for videos. Ensure the YOUTUBE_API_KEY environment variable is set. ```typescript import { YouTubeClient } from '@agentic/youtube' const youtube = new YouTubeClient() const res = await youtube.searchVideos({ query: 'cute kittens' }) ``` -------------------------------- ### Install @agentic/wikidata with yarn Source: https://github.com/code/lib-agentic/blob/main/docs/tools/wikidata.mdx Install the package using yarn. ```bash yarn add @agentic/wikidata ``` -------------------------------- ### Google Drive Client Example Usage Source: https://github.com/code/lib-agentic/blob/main/docs/tools/google-drive.mdx Demonstrates how to authenticate with Google Drive using `google-auth-library`, initialize the `googleapis` client, and then instantiate and use the `GoogleDriveClient` to list files, retrieve file metadata, and export a file's content. ```typescript import { GoogleDriveClient } from '@agentic/google-drive' import { GoogleAuth } from 'google-auth-library' import { google } from 'googleapis' const auth = new GoogleAuth({ scopes: 'https://www.googleapis.com/auth/drive' }) const drive = google.drive({ version: 'v3', auth }) const client = new GoogleDriveClient({ drive }) const result = await client.listFiles() const file = result.files[0]! const metadata = await client.getFile({ fileId: file.id }) const content = await client.exportFile({ fileId: file.id, mimeType: 'application/pdf' }) ``` -------------------------------- ### Install Google Custom Search Client Source: https://github.com/code/lib-agentic/blob/main/docs/tools/google-custom-search.mdx Install the `@agentic/google-custom-search` package using your preferred package manager. ```bash npm install @agentic/google-custom-search ``` ```bash yarn add @agentic/google-custom-search ``` ```bash pnpm add @agentic/google-custom-search ``` -------------------------------- ### Install Apollo Client Source: https://github.com/code/lib-agentic/blob/main/docs/tools/apollo.mdx Install the Apollo client package using your preferred package manager. ```bash npm install @agentic/apollo ``` ```bash yarn add @agentic/apollo ``` ```bash pnpm add @agentic/apollo ``` -------------------------------- ### Install @agentic/hunter with pnpm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/hunter.mdx Install the package using pnpm. ```bash pnpm add @agentic/hunter ``` -------------------------------- ### Install xsAI SDK with npm Source: https://github.com/code/lib-agentic/blob/main/docs/sdks/xsai.mdx Install the necessary packages for xsAI integration using npm. ```bash npm install @agentic/xsai xsai @xsai/tool ``` -------------------------------- ### Install @agentic/hunter with yarn Source: https://github.com/code/lib-agentic/blob/main/docs/tools/hunter.mdx Install the package using yarn. ```bash yarn add @agentic/hunter ``` -------------------------------- ### Install @agentic/hunter with npm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/hunter.mdx Install the package using npm. ```bash npm install @agentic/hunter ``` -------------------------------- ### Initialize and Use SerperClient Source: https://github.com/code/lib-agentic/blob/main/docs/tools/serper.mdx Import and initialize the SerperClient to perform Google searches. Ensure the SERPER_API_KEY environment variable is set. ```typescript import { SerperClient } from '@agentic/serper' const serper = new SerperClient() const res = await serper.search('latest news') ``` -------------------------------- ### Install @agentic/reddit with pnpm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/reddit.mdx Install the @agentic/reddit package using pnpm. ```bash pnpm add @agentic/reddit ``` -------------------------------- ### Install @agentic/reddit with yarn Source: https://github.com/code/lib-agentic/blob/main/docs/tools/reddit.mdx Install the @agentic/reddit package using yarn. ```bash yarn add @agentic/reddit ``` -------------------------------- ### Install @agentic/reddit with npm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/reddit.mdx Install the @agentic/reddit package using npm. ```bash npm install @agentic/reddit ``` -------------------------------- ### Initialize and Search with Wolfram Alpha Client Source: https://github.com/code/lib-agentic/blob/main/docs/tools/wolfram-alpha.mdx Import and initialize the `WolframAlphaClient` and use it to search for information. Ensure the `WOLFRAM_APP_ID` environment variable is set. ```typescript import { WolframAlphaClient } from '@agentic/wolfram-alpha' const wolframAlpha = new WolframAlphaClient() const res = await wolframAlpha.search('latest news') ``` -------------------------------- ### Install @agentic/polygon Source: https://github.com/code/lib-agentic/blob/main/docs/tools/polygon.mdx Install the package using npm, yarn, or pnpm. ```bash npm install @agentic/polygon ``` ```bash yarn add @agentic/polygon ``` ```bash pnpm add @agentic/polygon ``` -------------------------------- ### Install DuckDuckGo Client Source: https://github.com/code/lib-agentic/blob/main/docs/tools/duck-duck-go.mdx Install the `@agentic/duck-duck-go` package using npm, yarn, or pnpm. ```bash npm install @agentic/duck-duck-go ``` ```bash yarn add @agentic/duck-duck-go ``` ```bash pnpm add @agentic/duck-duck-go ``` -------------------------------- ### Install @agentic/bing with npm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/bing.mdx Install the Bing web search API client using npm. ```bash npm install @agentic/bing ``` -------------------------------- ### Install @agentic/google-docs with yarn Source: https://github.com/code/lib-agentic/blob/main/docs/tools/google-docs.mdx Install the package and its dependencies using yarn. ```bash yarn add @agentic/google-docs googleapis @google-cloud/local-auth ``` -------------------------------- ### Basic ExaClient Usage Source: https://github.com/code/lib-agentic/blob/main/docs/tools/exa.mdx Instantiate the ExaClient and perform a search query. Ensure the EXA_API_KEY environment variable is set. ```typescript import { ExaClient } from '@agentic/exa' const exa = new ExaClient() const res = await exa.search('latest news') ``` -------------------------------- ### Create and Run a Weather Agent with LlamaIndex Source: https://github.com/code/lib-agentic/blob/main/docs/sdks/llamaindex.mdx This example demonstrates how to create a weather agent using the LlamaIndex adapter. It requires API keys for weatherapi.com and OpenAI, which should be set in a `.env` file. ```typescript import 'dotenv/config' import { createLlamaIndexTools } from '@agentic/llamaindex' import { WeatherClient } from '@agentic/stdlib' import { openai } from '@llamaindex/openai' import { agent } from '@llamaindex/workflow' async function main() { const weather = new WeatherClient() const tools = createLlamaIndexTools(weather) const weatherAgent = agent({ name: 'Weather Agent', llm: openai({ model: 'gpt-4o-mini', temperature: 0 }), systemPrompt: 'You are a helpful assistant. Be as concise as possible.', tools }) const response = await weatherAgent.run( 'What is the weather in San Francisco?' ) console.log(response.data.result) } await main() ``` -------------------------------- ### Install @agentic/ai-sdk Source: https://github.com/code/lib-agentic/blob/main/docs/sdks/ai-sdk.mdx Install the Agentic AI SDK and the base AI package using npm, yarn, or pnpm. ```bash npm install @agentic/ai-sdk ai ``` ```bash yarn add @agentic/ai-sdk ai ``` ```bash pnpm add @agentic/ai-sdk ai ``` -------------------------------- ### Install @agentic/typeform with pnpm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/typeform.mdx Install the Typeform client package using pnpm. ```bash pnpm add @agentic/typeform ``` -------------------------------- ### Install @agentic/typeform with yarn Source: https://github.com/code/lib-agentic/blob/main/docs/tools/typeform.mdx Install the Typeform client package using yarn. ```bash yarn add @agentic/typeform ``` -------------------------------- ### Install @agentic/twitter with pnpm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/twitter.mdx Install the agentic twitter package using pnpm. ```bash pnpm add @agentic/twitter ``` -------------------------------- ### Install @agentic/typeform with npm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/typeform.mdx Install the Typeform client package using npm. ```bash npm install @agentic/typeform ``` -------------------------------- ### Install @agentic/twitter with yarn Source: https://github.com/code/lib-agentic/blob/main/docs/tools/twitter.mdx Install the agentic twitter package using yarn. ```bash yarn add @agentic/twitter ``` -------------------------------- ### Initialize and Use GoogleCustomSearchClient Source: https://github.com/code/lib-agentic/blob/main/docs/tools/google-custom-search.mdx Import and instantiate the `GoogleCustomSearchClient` to perform searches. Ensure `GOOGLE_API_KEY` and `GOOGLE_CSE_ID` environment variables are set, or provide them directly to the constructor. ```typescript import { GoogleCustomSearchClient } from '@agentic/google-custom-search' const googleCustomSearch = new GoogleCustomSearchClient() const results = await googleCustomSearch.search('latest news about openai') ``` -------------------------------- ### Install @agentic/twitter with npm Source: https://github.com/code/lib-agentic/blob/main/docs/tools/twitter.mdx Install the agentic twitter package using npm. ```bash npm install @agentic/twitter ``` -------------------------------- ### NovuClient Initialization and Usage Source: https://github.com/code/lib-agentic/blob/main/docs/tools/novu.mdx Demonstrates how to initialize the NovuClient and perform a search operation. The client automatically uses the NOVU_API_KEY environment variable for authentication. ```APIDOC ## Class: NovuClient ### Description Initializes the Novu API client. It automatically picks up the `NOVU_API_KEY` environment variable for authentication. ### Usage ```ts import { NovuClient } from '@agentic/novu' // Initialize the client const novu = new NovuClient() // Example of a method call (e.g., search) const res = await novu.search('latest news') ``` ### Environment Variables - `NOVU_API_KEY`: Required for authenticating with the Novu API. ```