Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions server/services/llm/grok.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: "LLM service implementation using Grok's API with OpenAI-compatible
<Card
title="Grok LLM API Reference"
icon="code"
href="https://reference-server.pipecat.ai/en/latest/api/pipecat.services.grok.llm.html"
href="https://reference-server.pipecat.ai/en/latest/api/pipecat.services.xai.llm.html"
>
Pipecat's API methods for Grok integration
</Card>
Expand Down Expand Up @@ -89,7 +89,7 @@ This service uses the same settings as `OpenAILLMService`. See [OpenAI LLM Setti

```python
import os
from pipecat.services.grok import GrokLLMService
from pipecat.services.xai.llm import GrokLLMService

llm = GrokLLMService(
api_key=os.getenv("XAI_API_KEY"),
Expand All @@ -100,7 +100,7 @@ llm = GrokLLMService(
### With Custom Settings

```python
from pipecat.services.grok import GrokLLMService
from pipecat.services.xai.llm import GrokLLMService

llm = GrokLLMService(
api_key=os.getenv("XAI_API_KEY"),
Expand Down
24 changes: 12 additions & 12 deletions server/services/s2s/grok.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: "Real-time speech-to-speech service implementation using xAI's Grok
<Card
title="Grok Realtime API Reference"
icon="code"
href="https://reference-server.pipecat.ai/en/latest/api/pipecat.services.grok.realtime.llm.html"
href="https://reference-server.pipecat.ai/en/latest/api/pipecat.services.xai.realtime.llm.html"
>
Pipecat's API methods for Grok Realtime integration
</Card>
Expand Down Expand Up @@ -55,7 +55,7 @@ Before using Grok Realtime services, you need:

### Required Environment Variables

- `GROK_API_KEY`: Your xAI API key for authentication
- `XAI_API_KEY`: Your xAI API key for authentication

### Key Features

Expand Down Expand Up @@ -158,18 +158,18 @@ Grok provides several built-in tools in addition to custom function tools:

```python
import os
from pipecat.services.grok.realtime import GrokRealtimeLLMService
from pipecat.services.xai.realtime.llm import GrokRealtimeLLMService

llm = GrokRealtimeLLMService(
api_key=os.getenv("GROK_API_KEY"),
api_key=os.getenv("XAI_API_KEY"),
)
```

### With Session Configuration

```python
from pipecat.services.grok.realtime import GrokRealtimeLLMService
from pipecat.services.grok.realtime.events import (
from pipecat.services.xai.realtime.llm import GrokRealtimeLLMService
from pipecat.services.xai.realtime.events import (
SessionProperties,
TurnDetection,
AudioConfiguration,
Expand All @@ -189,7 +189,7 @@ session_properties = SessionProperties(
)

llm = GrokRealtimeLLMService(
api_key=os.getenv("GROK_API_KEY"),
api_key=os.getenv("XAI_API_KEY"),
settings=GrokRealtimeLLMService.Settings(
session_properties=session_properties,
),
Expand All @@ -199,15 +199,15 @@ llm = GrokRealtimeLLMService(
### With Built-in Tools

```python
from pipecat.services.grok.realtime import GrokRealtimeLLMService
from pipecat.services.grok.realtime.events import (
from pipecat.services.xai.realtime.llm import GrokRealtimeLLMService
from pipecat.services.xai.realtime.events import (
SessionProperties,
WebSearchTool,
XSearchTool,
)

llm = GrokRealtimeLLMService(
api_key=os.getenv("GROK_API_KEY"),
api_key=os.getenv("XAI_API_KEY"),
settings=GrokRealtimeLLMService.Settings(
session_properties=SessionProperties(
instructions="You are a helpful assistant with access to web search.",
Expand All @@ -225,8 +225,8 @@ llm = GrokRealtimeLLMService(

```python
from pipecat.frames.frames import LLMUpdateSettingsFrame
from pipecat.services.grok.realtime.llm import GrokRealtimeLLMSettings
from pipecat.services.grok.realtime.events import SessionProperties
from pipecat.services.xai.realtime.llm import GrokRealtimeLLMSettings
from pipecat.services.xai.realtime.events import SessionProperties

await task.queue_frame(
LLMUpdateSettingsFrame(
Expand Down
Loading