From a4fe0a0c2e31b5825e9e947158c4a089bcd34450 Mon Sep 17 00:00:00 2001 From: Kye Gomez Date: Thu, 9 Jan 2025 19:07:28 -0500 Subject: [PATCH] [MODEL DOCS] --- docs/swarms/examples/openrouter.md | 27 +++++++++++++++++++++++++++ docs/swarms/examples/xai.md | 27 +++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 docs/swarms/examples/openrouter.md create mode 100644 docs/swarms/examples/xai.md diff --git a/docs/swarms/examples/openrouter.md b/docs/swarms/examples/openrouter.md new file mode 100644 index 000000000..2c3f1402d --- /dev/null +++ b/docs/swarms/examples/openrouter.md @@ -0,0 +1,27 @@ +# Agent with XAI + +- Add your `OPENROUTER_API_KEY` in the `.env` file + +- Select your model_name like `openrouter/google/palm-2-chat-bison` follows [LiteLLM conventions](https://docs.litellm.ai/docs/providers/openrouter) + +- Execute your agent! + + +```python +from swarms import Agent +import os +from dotenv import load_dotenv + +load_dotenv() + +# Initialize the agent with ChromaDB memory +agent = Agent( + agent_name="Financial-Analysis-Agent", + model_name="openrouter/google/palm-2-chat-bison", + system_prompt="Agent system prompt here", + agent_description="Agent performs financial analysis.", +) + +# Run a query +agent.run("What are the components of a startup's stock incentive equity plan?") +``` \ No newline at end of file diff --git a/docs/swarms/examples/xai.md b/docs/swarms/examples/xai.md new file mode 100644 index 000000000..47acfec9e --- /dev/null +++ b/docs/swarms/examples/xai.md @@ -0,0 +1,27 @@ +# Agent with XAI + +- Add your `XAI_API_KEY` in the `.env` file + +- Select your model_name like `xai/grok-beta` follows [LiteLLM conventions](https://docs.litellm.ai/docs/providers/xai) + +- Execute your agent! + + +```python +from swarms import Agent +import os +from dotenv import load_dotenv + +load_dotenv() + +# Initialize the agent with ChromaDB memory +agent = Agent( + agent_name="Financial-Analysis-Agent", + model_name="xai/grok-beta", + system_prompt="Agent system prompt here", + agent_description="Agent performs financial analysis.", +) + +# Run a query +agent.run("What are the components of a startup's stock incentive equity plan?") +``` \ No newline at end of file