### Run SpinAI Agent Source: https://github.com/fallomai/spinai/blob/main/apps/docs/get-started/quickstart.mdx Starts the SpinAI agent development server. ```javascript npm run dev ``` -------------------------------- ### Smithery MCP Installation Example Source: https://github.com/fallomai/spinai/blob/main/templates/basic-mcp-agent/README.md An example of installing a smithery MCP using the spinai command-line tool, which automatically configures the `mcp-config.ts` file. ```bash npx spinai-mcp install @smithery-ai/github --provider smithery --config "{\"githubPersonalAccessToken\":\"abc\"}" ``` -------------------------------- ### Configure Environment Variables Source: https://github.com/fallomai/spinai/blob/main/apps/docs/get-started/quickstart.mdx Sets up the necessary environment variables for the agent, typically including the LLM API key. This example shows the OpenAI API key configuration. ```bash OPENAI_API_KEY=your_api_key_here ``` -------------------------------- ### Environment Variables Setup Source: https://github.com/fallomai/spinai/blob/main/templates/mintlify-docs-updater/README.md Example of setting up essential environment variables for the Mintlify Doc Updater, including OpenAI and GitHub API keys. ```bash # Edit .env with your keys: # OPENAI_API_KEY=your-openai-key # GITHUB_TOKEN=your-github-token ``` -------------------------------- ### Create SpinAI Project Source: https://github.com/fallomai/spinai/blob/main/apps/docs/mcp/example.mdx Command to create a new SpinAI project. Users can select a default template or a specific 'GitHub MCP Agent' template for pre-configured setup. ```bash npx create-spinai ``` -------------------------------- ### Start Local Development Server Source: https://github.com/fallomai/spinai/blob/main/apps/docs/README.md Starts the Mintlify local development server from the root of your documentation project. ```bash mintlify dev ``` -------------------------------- ### Install GitHub MCP Actions Source: https://github.com/fallomai/spinai/blob/main/apps/docs/mcp/example.mdx CLI command to install and configure GitHub MCP actions for SpinAI. It specifies the provider and allows for initial configuration, recommending the use of environment variables for sensitive tokens. ```bash npx spinai-mcp install @smithery-ai/github --provider smithery --config "{\"githubPersonalAccessToken\":\"move_my_token_to_a_dot_env_after\"}" ``` -------------------------------- ### Install Mintlify CLI Source: https://github.com/fallomai/spinai/blob/main/apps/docs/README.md Installs the Mintlify Command Line Interface globally using npm. ```bash npm i -g mintlify ``` -------------------------------- ### Environment Variables Setup Source: https://github.com/fallomai/spinai/blob/main/apps/docs/mcp/example.mdx Configuration for environment variables required by the SpinAI application, including OpenAI API key and GitHub personal access token. It also provides instructions on obtaining and securing these credentials. ```bash OPENAI_API_KEY="your_openai_api_key" GITHUB_TOKEN="your_github_token" ``` -------------------------------- ### Create SpinAI Project Source: https://github.com/fallomai/spinai/blob/main/apps/docs/get-started/quickstart.mdx Initializes a new SpinAI project using the command-line interface. ```bash npx create-spinai ``` -------------------------------- ### Run SpinAI Agent Source: https://github.com/fallomai/spinai/blob/main/apps/docs/mcp/example.mdx This command starts the SpinAI agent in development mode. The agent can then process user inputs to perform GitHub tasks. ```bash npm run dev ``` -------------------------------- ### Start Development Server Source: https://github.com/fallomai/spinai/blob/main/templates/mintlify-docs-updater/CONTRIBUTING.md Command to start the project in development mode. ```bash npm run dev # or yarn dev ``` -------------------------------- ### Start Development Server Source: https://github.com/fallomai/spinai/blob/main/templates/mintlify-docs-updater/README.md Commands to start the SpinAI development server, either using npm or yarn. ```bash npm run dev # or yarn dev ``` -------------------------------- ### Re-install Mintlify Dependencies Source: https://github.com/fallomai/spinai/blob/main/apps/docs/README.md Installs or re-installs project dependencies, often used to resolve issues with the local development server. ```bash mintlify install ``` -------------------------------- ### Local Testing with ngrok Source: https://github.com/fallomai/spinai/blob/main/templates/github-code-review-agent/README.md Steps to set up a local development environment for testing the GitHub webhook using ngrok. This involves installing ngrok, starting the development server, and creating an ngrok tunnel. ```bash # Install ngrok npm install -g ngrok # Start your server npm run dev # In another terminal, create a tunnel ngrok http 3000 ``` -------------------------------- ### Install Dependencies Source: https://github.com/fallomai/spinai/blob/main/templates/basic-mcp-agent/README.md Installs the necessary project dependencies using either npm or yarn. ```bash npm install # or yarn install ``` -------------------------------- ### Install MCP from Smithery Source: https://github.com/fallomai/spinai/blob/main/apps/docs/mcp/overview.mdx Installs an MCP locally using the spinai-mcp helper function. Supports including environment variables via a JSON configuration string. ```bash npx spinai-mcp install @smithery-ai/github --provider smithery npx spinai-mcp install @smithery-ai/github --provider smithery --config "{\"githubPersonalAccessToken\":\"move_my_token_to_a_dot_env_after\"}" ``` -------------------------------- ### Create Environment File Source: https://github.com/fallomai/spinai/blob/main/templates/mintlify-docs-updater/CONTRIBUTING.md Copies the example environment file to create a new environment file for local development. ```bash cp .env.example .env ``` -------------------------------- ### Install Dependencies Source: https://github.com/fallomai/spinai/blob/main/templates/github-code-review-agent/README.md Installs the necessary Node.js dependencies for the project. ```bash npm install ``` -------------------------------- ### SpinAI Agent Input Examples Source: https://github.com/fallomai/spinai/blob/main/apps/docs/mcp/example.mdx Examples of how to structure the `input` variable in TypeScript to instruct the SpinAI agent to perform various GitHub operations, such as creating repositories, issues, or searching for repositories. ```typescript // Create a new repository input: "Create a github repo called 'GlubGlub' please"; // Create an issue in an existing repository input: "Create an issue in my repository about adding documentation"; // Search for repositories input: "Find repositories related to machine learning"; ``` -------------------------------- ### Calculator Agent Setup and Usage Source: https://github.com/fallomai/spinai/blob/main/apps/docs/examples/calculator-agent/overview.mdx Demonstrates how to set up and use a calculator agent with SpinAI. It imports necessary modules, defines available actions (sum, minus), configures the agent with instructions and a model, and shows an example of processing a natural language mathematical expression. ```typescript import { createAgent } from "spinai"; import { openai } from "@ai-sdk/openai"; import { sum } from "./actions/sum"; import { minus } from "./actions/minus"; const calculatorAgent = createAgent({ instructions: `You are a calculator agent that helps users perform mathematical calculations.`, actions: [sum, minus], model: openai("gpt-4o"), }); async function main() { const { response } = await calculatorAgent({ input: "What is 5 plus 3 - 1?", }); console.log(response); } main().catch(console.error); ``` -------------------------------- ### Planning Schema Example Source: https://github.com/fallomai/spinai/blob/main/apps/docs/core-concepts/task-loop.mdx An example of the structured JSON schema used by SpinAI for planning decisions. This schema includes reasoning, the next actions to be executed, and their associated parameters, guiding the agent's workflow. ```json { "reasoning": "The user is asking for a summary of the previous conversation. I need to retrieve the conversation history and then generate a summary.", "next_actions": [ { "action_id": "get_conversation_history", "parameters": {} } ] } ``` -------------------------------- ### Run the Agent Source: https://github.com/fallomai/spinai/blob/main/templates/basic-mcp-agent/README.md Starts the SpinAI agent using either npm or yarn. ```bash npm start # or yarn start ``` -------------------------------- ### Environment Variable Setup Source: https://github.com/fallomai/spinai/blob/main/apps/docs/examples/calculator-agent/overview.mdx Shows how to set up the necessary environment variable for API key authentication, specifically for OpenAI. ```bash # .env OPENAI_API_KEY=your-key-here ``` -------------------------------- ### Clone Repository and Install Dependencies Source: https://github.com/fallomai/spinai/blob/main/templates/mintlify-docs-updater/CONTRIBUTING.md Steps to clone the project repository and install its dependencies using npm or yarn. ```bash git clone https://github.com/your-username/mintlify-doc-updater.git cd mintlify-doc-updater npm install # or yarn ``` -------------------------------- ### Environment Variables Configuration Source: https://github.com/fallomai/spinai/blob/main/templates/github-code-review-agent/README.md Copies the example environment file and lists the required variables for configuring the bot, including API keys for OpenAI and SpinAI, and the GitHub token. ```bash cp .env.example .env ``` ```env # OpenAI API Key for the code review OPENAI_API_KEY=your_openai_api_key_here # GitHub Personal Access Token with repo scope GITHUB_TOKEN=your_github_token_here # SpinAI API Key for agent tracking and monitoring SPINAI_API_KEY=your_spinai_api_key_here # Port for the webhook server (optional) PORT=3000 ``` -------------------------------- ### SpinAI Agent with GitHub MCP Actions Source: https://github.com/fallomai/spinai/blob/main/apps/docs/mcp/example.mdx TypeScript code for setting up a SpinAI agent. It demonstrates how to create actions from an MCP configuration, integrate with OpenAI, define agent instructions, and execute a sample command to create a GitHub repository. ```typescript import { createAgent, createActionsFromMcpConfig } from "spinai"; import { openai } from "@ai-sdk/openai"; import * as dotenv from "dotenv"; // @ts-ignore import mcpConfig from "../mcp-config.ts"; dotenv.config(); async function main() { // Create actions from MCP configuration console.log("Setting up MCP actions..."); const mcpActions = await createActionsFromMcpConfig({ config: mcpConfig, // if you didn't include your GITHUB_TOKEN in your mcp-config.ts envMapping: { githubPersonalAccessToken: process.env.GITHUB_TOKEN, }, // If there are any actions you would like to exclude. A full list of actions can be found at https://smithery.ai/server/@smithery-ai/github excludedActions: ["smithery_ai_github_get_issue"], }); const agent = createAgent({ instructions: `You are a GitHub assistant that can help with repository management. Use the available GitHub actions to help users with their requests.`, actions: [...mcpActions], model: openai("gpt-4o"), }); // Run the agent with a test command const { response } = await agent({ input: "Create a github repo called 'GlubGlub' please", }); console.log("Response:", response); } main().catch(console.error); ``` -------------------------------- ### API Response Body Example Source: https://github.com/fallomai/spinai/blob/main/templates/vercel-serverless/README.md An example JSON response from the calculator API, showing the result of the mathematical operation and any associated messages. ```json { "response": { "finalNumber": 12 }, "messages": [...] } ``` -------------------------------- ### Project Structure Source: https://github.com/fallomai/spinai/blob/main/apps/docs/examples/calculator-agent/overview.mdx Illustrates the directory structure for the calculator agent project. It shows the 'src' directory containing action files for 'sum.ts' and 'minus.ts', and the main agent setup file 'index.ts'. ```bash src/ ├── actions/ │ ├── sum.ts # Addition operation │ └── minus.ts # Subtraction operation └── index.ts # Main agent setup ``` -------------------------------- ### Standard Mintlify Configuration Source: https://github.com/fallomai/spinai/blob/main/templates/mintlify-docs-updater/README.md Configuration for a standard Mintlify setup where documentation resides within the same repository as the code. ```typescript // For a standard Mintlify setup (docs in same repo) export const defaultConfig: Required = { docsPath: "docs", // Path to your Mintlify docs isMonorepo: false, docsRepoOwner: "your-username", // Your GitHub username or org docsRepoName: "your-repo", // The repository name docsBranch: "main", fileTypes: [".mdx", ".md"], ignorePaths: ["**/node_modules/**"], createNewPr: true, labels: ["documentation"], styleGuide: "", }; ``` -------------------------------- ### Run SpinAI Agent Source: https://github.com/fallomai/spinai/blob/main/templates/github-mcp-agent/README.md Command to start the SpinAI agent in development mode. ```bash npm run dev ``` -------------------------------- ### API Request Body Example Source: https://github.com/fallomai/spinai/blob/main/templates/vercel-serverless/README.md An example JSON payload for testing the calculator API. The 'input' field contains the mathematical expression to be evaluated. ```json { "input": "5+7" } ``` -------------------------------- ### Monorepo Mintlify Configuration Source: https://github.com/fallomai/spinai/blob/main/templates/mintlify-docs-updater/README.md Configuration for a monorepo setup, specifying the path to documentation within a subdirectory. ```typescript // For a monorepo setup (e.g., docs in apps/docs) export const defaultConfig: Required = { docsPath: "apps/docs", // Adjust to your monorepo docs path isMonorepo: true, docsRepoOwner: "", docsRepoName: "", docsBranch: "main", fileTypes: [".mdx", ".md"], ignorePaths: ["**/node_modules/**"], createNewPr: true, labels: ["documentation"], styleGuide: "", }; ``` -------------------------------- ### Run Your Agent Source: https://github.com/fallomai/spinai/blob/main/README.md Start your AI agent development server using npm. This command typically runs a script defined in your package.json. ```bash npm run dev ``` -------------------------------- ### Run Your Agent Source: https://github.com/fallomai/spinai/blob/main/packages/spinai/README.md Start your AI agent development server using npm. This command typically runs a script defined in your package.json. ```bash npm run dev ``` -------------------------------- ### Action Parameter Schema Example Source: https://github.com/fallomai/spinai/blob/main/apps/docs/core-concepts/state-and-parameters.mdx Provides an example of a JSON schema used to define parameters for an action. This schema specifies the expected data types and whether parameters are required. ```json // Example parameter schema parameters: { type: "object", properties: { a: { type: "number", description: "First number" }, b: { type: "number", description: "Second number" }, }, required: ["a", "b"], } ``` -------------------------------- ### MCP Configuration Example Source: https://github.com/fallomai/spinai/blob/main/templates/basic-mcp-agent/README.md Defines a sample MCP action named 'my_mcp_name' with a command and arguments. This configuration is typically found in `mcp-config.ts`. ```typescript export default { my_mcp_name: { command: "npx", args: ["-y", "my", "example", "args"], }, }; ``` -------------------------------- ### Run Local Development Server Source: https://github.com/fallomai/spinai/blob/main/templates/vercel-serverless/README.md Starts the custom development server for local testing, mimicking Vercel's serverless environment with enhanced debugging. It automatically discovers API endpoints and maps them for easy access. ```bash npm run dev ``` -------------------------------- ### Deploy SpinAI Agent as API with Hono Source: https://github.com/fallomai/spinai/blob/main/apps/docs/mcp/example.mdx This TypeScript code demonstrates how to wrap a SpinAI agent in a Hono web server to expose it as an API endpoint. It sets up the agent with instructions and GitHub actions, then defines a POST endpoint to handle incoming requests with user input and return the agent's response. ```typescript import { Hono } from "hono"; import { createAgent, createActionsFromMcpConfig } from "spinai"; import { openai } from "@ai-sdk/openai"; import mcpConfig from "./mcp-config.ts"; // your dotenv config and other stuff here const app = new Hono(); const mcpActions = await createActionsFromMcpConfig(mcpConfig); const agent = createAgent({ instructions: `You are a GitHub assistant that can help with repository management. Use the available GitHub actions to help users with their requests.`, actions: [...mcpActions], model: openai("gpt-4o"), }); app.post("/github-assistant", async (c) => { const { input } = await c.req.tson(); const { response } = await agent({ input }); return c.tson({ response }); }); export default app; ``` -------------------------------- ### Create Interactive Chat Loop with SpinAI Source: https://github.com/fallomai/spinai/blob/main/apps/docs/mcp/example.mdx This TypeScript code implements an interactive command-line chat interface for the SpinAI GitHub assistant. It uses Node.js `readline` to handle user input, maintains conversation history, and allows for ongoing interactions with the agent. The agent is configured with instructions, actions, and an OpenAI model. ```typescript import { createAgent, createActionsFromMcpConfig } from "spinai"; import * as dotenv from "dotenv"; import { openai } from "@ai-sdk/openai"; import * as readline from "readline"; // @ts-ignore import mcpConfig from "../mcp-config.ts"; dotenv.config(); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); async function chat() { console.log("Setting up..."); const mcpActions = await createActionsFromMcpConfig(mcpConfig); console.log("\n🤖 Ready! Type your message (or 'exit' to quit)\n"); const agent = createAgent({ instructions: `You are a GitHub assistant that can help with repository management. Use the available GitHub actions to help users with their requests.`, actions: [...mcpActions], model: openai("gpt-4o-mini"), }); let messageHistory: any[] = []; function getInput() { rl.question("> ", async (input) => { if (input.toLowerCase() === "exit") { rl.close(); return; } try { const { messages, response } = await agent({ input, messages: messageHistory, }); // Update message history messageHistory = messages; // Show any tool calls const toolCalls = messages.filter((m) => m.role === "tool"); if (toolCalls.length > 0) { console.log("\nActions:"); toolCalls.forEach((call) => { console.log(`• ${call.content[0].toolName}`); }); console.log(); } console.log(`Assistant: ${response}\n`); } catch (error) { console.error("\nError:", error, "\n"); } getInput(); }); } getInput(); } chat().catch(console.error); // Handle clean exit rl.on("close", () => { console.log("\nGoodbye!"); process.exit(0); }); ``` -------------------------------- ### Create SpinAI Project Source: https://github.com/fallomai/spinai/blob/main/templates/mintlify-docs-updater/README.md Command to create a new SpinAI project. This is the initial step to set up the documentation updater. ```bash npx create-spinai ``` -------------------------------- ### Project Initialization Source: https://github.com/fallomai/spinai/blob/main/apps/docs/examples/calculator-agent/overview.mdx Provides the command to create a new SpinAI project using npx. ```bash npx create-spinai ``` -------------------------------- ### Create SpinAI Project Source: https://github.com/fallomai/spinai/blob/main/templates/github-code-review-agent/README.md Command to create a new SpinAI project using the github-code-reviewer template. ```bash npx create-spinai ``` -------------------------------- ### Configure OpenAI API Key Source: https://github.com/fallomai/spinai/blob/main/templates/basic-mcp-agent/README.md Creates a .env file in the project root and adds the OpenAI API key for authentication. ```bash OPENAI_API_KEY=your_api_key_here ``` -------------------------------- ### Create SpinAI Project Source: https://github.com/fallomai/spinai/blob/main/packages/spinai/README.md Use the SpinAI CLI to initialize a new AI agent project. This command scaffolds the project structure and necessary configuration files. ```bash npx create-spinai ``` -------------------------------- ### Using the Agent Directly Source: https://github.com/fallomai/spinai/blob/main/templates/mintlify-docs-updater/README.md Example of how to import and use the `createDocUpdateAgent` function directly within a TypeScript project. ```typescript import { createDocUpdateAgent } from "mintlify-doc-updater"; const agent = createDocUpdateAgent({ config: { docsPath: "docs" } }); // Use the agent directly const result = await agent({ input: "Review pull request #123", externalCustomerId: "user123", state: { owner: "org", repo: "repo", pull_number: 123, config: {} // Will be populated from your config } }); ``` -------------------------------- ### Create SpinAI Project Source: https://github.com/fallomai/spinai/blob/main/README.md Use the SpinAI CLI to initialize a new AI agent project. This command scaffolds the project structure and necessary configuration files. ```bash npx create-spinai ``` -------------------------------- ### Create SpinAI Project Source: https://github.com/fallomai/spinai/blob/main/templates/github-mcp-agent/README.md Command to create a new SpinAI project using the recommended template. ```bash npx create-spinai ``` -------------------------------- ### Python Agent Initialization and Task Loop Execution Source: https://github.com/fallomai/spinai/blob/main/apps/docs/core-concepts/task-loop.mdx Illustrative Python code demonstrating how an agent might be initialized and how the task loop would be invoked to process user input and generate a response. This includes setting up the agent, providing input, and handling the output. ```python from spinai.agent import Agent # Initialize the agent agent = Agent(config='path/to/agent/config.yaml') # User input user_input = "What was the main topic of our last conversation?" # Execute the task loop response = agent.run(user_input) # Process the response print(response.output) print(response.metrics) ``` -------------------------------- ### Run Project Tests and Linting Source: https://github.com/fallomai/spinai/blob/main/templates/mintlify-docs-updater/CONTRIBUTING.md Commands for running tests, linting, and type checking the project. ```bash # Run tests npm test # Run linting npm run lint # Type checking npm run check-types ``` -------------------------------- ### Development and Build Commands Source: https://github.com/fallomai/spinai/blob/main/templates/github-code-review-agent/README.md Common commands for developing and building the project, including running in development mode with hot reload, building for production, linting, and type checking. ```bash # Run in development mode with hot reload npm run dev # Build the project npm run build # Run linting npm run lint # Type checking npm run check-types ``` -------------------------------- ### Vercel Deployment Commands Source: https://github.com/fallomai/spinai/blob/main/templates/vercel-serverless/README.md Commands to deploy the project to Vercel. Use `vercel deploy` for general deployment and `vercel deploy --prod` for production deployments. ```bash vercel deploy # or for production vercel deploy --prod ``` -------------------------------- ### Configure Environment Variables Source: https://github.com/fallomai/spinai/blob/main/README.md Set up your LLM API key in the .env file. SpinAI defaults to OpenAI, but you can configure other providers. ```bash OPENAI_API_KEY=your_api_key_here ``` -------------------------------- ### Configure Environment Variables Source: https://github.com/fallomai/spinai/blob/main/packages/spinai/README.md Set up your LLM API key in the .env file. SpinAI defaults to OpenAI, but you can configure other providers. ```bash OPENAI_API_KEY=your_api_key_here ``` -------------------------------- ### SpinAI Agent Creation Parameters Source: https://github.com/fallomai/spinai/blob/main/apps/docs/core-concepts/agents.mdx Details the parameters available when creating a SpinAI agent. This includes essential parameters like instructions, model, and actions, as well as optional parameters for agent identification and custom logging. ```APIDOC Agent Creation Parameters: createAgent({ instructions: string, // Required: Agent description and task model: LanguageModelV1, // Required: LLM to use for decision making actions: Action[], // Required: Actions the agent can execute agentId?: string, // Optional: Agent identifier for logging spinApiKey?: string, // Optional: SpinAI API key for logging customLoggingEndpoint?: string // Optional: Custom logging endpoint for metrics }) ``` -------------------------------- ### Separate Repository Mintlify Configuration Source: https://github.com/fallomai/spinai/blob/main/templates/mintlify-docs-updater/README.md Configuration for when Mintlify documentation is hosted in a separate GitHub repository. ```typescript // For docs in a separate repository export const defaultConfig: Required = { docsPath: "docs", isMonorepo: false, docsRepoOwner: "your-org", // Owner of the docs repo docsRepoName: "docs", // Name of the docs repo docsBranch: "main", fileTypes: [".mdx", ".md"], ignorePaths: ["**/node_modules/**"], createNewPr: true, labels: ["documentation"], styleGuide: "", }; ``` -------------------------------- ### Environment Variables for SpinAI Source: https://github.com/fallomai/spinai/blob/main/templates/mintlify-docs-updater/README.md List of environment variables required or optional for the SpinAI agent, including API keys and port configuration. ```bash - OPENAI_API_KEY (required): Your OpenAI API key - GITHUB_TOKEN (required): GitHub token with repo access - PORT (optional): Server port (default: 3000) - SPINAI_API_KEY (optional): SpinAI API key for monitoring and observability. Get one at [app.spinai.dev](https://app.spinai.dev) ``` -------------------------------- ### Create a Simple Action Source: https://github.com/fallomai/spinai/blob/main/apps/docs/core-concepts/actions.mdx Demonstrates how to create a basic action using `createAction` that adds two numbers. It defines the action's ID, description, and parameters, including their types and requirements. ```typescript import { createAction } from "spinai"; export const sum = createAction({ id: "sum", description: "Adds two numbers together.", parameters: { type: "object", properties: { a: { type: "number", description: "First number to add" }, b: { type: "number", description: "Second number to add" }, }, required: ["a", "b"], }, async run({ parameters }) { const { a, b } = parameters || {}; const result = a + b; return result; }, }); ``` -------------------------------- ### Vercel CLI Development Source: https://github.com/fallomai/spinai/blob/main/templates/vercel-serverless/README.md Utilizes Vercel's official command-line interface to run the development environment. This allows for testing the serverless functions locally before deployment. ```bash npm run vercel-dev # or vercel dev ``` -------------------------------- ### createActionsFromMcpConfig Parameters Source: https://github.com/fallomai/spinai/blob/main/apps/docs/mcp/overview.mdx Details the parameters for the `createActionsFromMcpConfig` function, used to integrate MCP actions into SpinAI agents. It outlines the types and descriptions for configuration, environment variable mapping, and action inclusion/exclusion. ```APIDOC createActionsFromMcpConfig(params: { config: McpConfig; envMapping?: Record; excludedActions?: string[]; includedActions?: string[]; }): Promise; Parameters: config: McpConfig The MCP config file (mcp-config.ts). envMapping: Record Environment variable mappings to apply to all MCPs. Format: { "MCP_VAR_NAME": process.env.myVariable }. If this AND one in mcp-config.ts are passed in, it will prioritize this one. excludedActions: string[] IDs of actions to exclude. includedActions: string[] IDs of actions to include (if empty, all actions except excluded ones are included). ``` -------------------------------- ### Create Calculator Agent Source: https://github.com/fallomai/spinai/blob/main/apps/docs/get-started/introduction.mdx Demonstrates how to create a calculator agent using the `createAgent` function. This agent is configured with instructions, available actions (sum, minus), and a specific LLM model (gpt-4o). ```typescript const calculatorAgent = createAgent({ instructions: `You are a calculator agent that helps users perform mathematical calculations.`, actions: [sum, minus], model: openai("gpt-4o"), }); ``` -------------------------------- ### Environment Configuration Source: https://github.com/fallomai/spinai/blob/main/templates/github-mcp-agent/README.md Configuration file for setting API keys for OpenAI and GitHub. ```env OPENAI_API_KEY="your_openai_api_key" GITHUB_TOKEN="your_github_token" ```