Skip to content
Merged
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
41 changes: 41 additions & 0 deletions website/docs/components/models/perplexity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: 'Perplexity Models'
description: 'Instructions for using language models hosted on Perplexity with Spice.'
sidebar_label: 'Perplexity'
sidebar_position: 4
---

To use a language model hosted on Perplexity, specify `perplexity` in the `from` field.

To use a specific model, include its model ID in the `from` field (see example below). If not specified, the default model is `sonar`.

```yaml
models:
- name: webs
from: perplexity:sonar
params:
perplexity_auth_token: ${ secrets:SPICE_PERPLEXITY_AUTH_TOKEN }
```

The following parameters are specific to Perplexity models:

| Parameter | Description | Default |
| ---------------------------------- | ------------------------------------------------ | ------- |
| `perplexity_auth_token` | The Perplexity API authentication token. | - |
| `perplexity_*` | Additional, perplexity specific parameters to use on all requests. See [Perplexity API Reference](https://docs.perplexity.ai/api-reference/chat-completions) | - |

**Note:** Like other models in Spice, Perplexity can set default overrides for OpenAI parameters. See [Parameter Overrides](../../features/large-language-models/parameter_overrides.md).

### Example Configuration

```yaml
models:
- name: webs
from: perplexity:sonar
params:
perplexity_auth_token: ${ secrets:SPICE_PERPLEXITY_AUTH_TOKEN }
perplexity_search_domain_filter:
- docs.spiceai.org
- huggingface.co
openai_temperature: 0.3141595
```
15 changes: 15 additions & 0 deletions website/docs/components/tools/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ A tool is a function or operation that can be called directly or by a [language

For details about providing LLMs tool access, see [Language Model Tools](/docs/features/large-language-models/tools).

**Example**

```yaml
tools:
- name: arpanet
from: websearch
description: 'Search the web for information.'
params:
engine: perplexity
perplexity_auth_token: ${ secrets:SPICE_PERPLEXITY_AUTH_TOKEN }
```

For details on tool specifications, see the [Tools Spicepod Reference](/docs/reference/spicepod/tools).

### Available Tools
Expand All @@ -23,6 +35,9 @@ For details on tool specifications, see the [Tools Spicepod Reference](/docs/ref
| `top_n_sample` | Sample the top N rows from a table based on a specified ordering. | `auto` |
| `memory:load` | Retrieve all stored memories from the last time period. | `memory` |
| `memory:store` | Store information from LLM interaction(s) for future reference. | `memory` |
| [`websearch`][websearch] | Search the web for information. | - |

[websearch]: /docs/components/tools/websearch

### Tool Groups

Expand Down
56 changes: 56 additions & 0 deletions website/docs/components/tools/websearch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: 'Web Search Tool'
sidebar_label: 'Websearch'
---

The Web Search Tool enables Spice models to search the web for information. The tool is available through the `websearch` tool, and backed by different search engines.

## Usage
```yaml
tools:
- name: the_internet
from: websearch
description: "Search the web for information."
params:
engine: perplexity
perplexity_auth_token: ${ secrets:SPICE_PERPLEXITY_AUTH_TOKEN }
```
# Configuration
## `from`

The `from` field is used to specify the tool to use. For the Web Search Tool, use `websearch`.

## `name`

The `name` field is used to specify the name of the tool. This name is used:
- To reference the tool in the model's `params.tools` field
- To make HTTP requests to the tool via the [API](/docs/api/HTTP/post), i.e. `v1/tools/{name}`.
- Provided to any language model that uses the tool.

## `description`

The `description` field is used to provide a description of the tool. This description is provided to any language model that uses the tool.

## `params`

The `params` field is used to ... The following parameters are supported:
- `engine`: The search engine to use. Possible values:
- `perplexity`: Use the Perplexity search engine.
- `engine_*`: Each search engine has its own set of parameters. See the documentation for the specific search engine for more information.

# Search Engines
- [Perplexity](https://perplexity.com): Powered by Perplexity [Sonar](https://docs.perplexity.ai/).

## Perplexity
To define a Perplexity search engine, use the following parameters:
- `perplexity_auth_token` (required): The authentication token for the Perplexity API. Use the [secret replacement syntax](../secret-stores/index.md) to reference a secret, e.g. `${secrets:my_perplexity_auth_token}`. To get an authentication token, see Perplexity's [Getting Started](https://docs.perplexity.ai/guides/getting-started).
- `perplexity_return_images` (default: false): Determines whether or not a request should return images.
- `perplexity_return_related_questions` (default: false): Determines whether or not a request should return related questions.
- `perplexity_search_domain_filter`: Given a list of domains, limit the citations used by the online model to URLs from the specified domains. Currently limited to only 3 domains for whitelisting and blacklisting. For blacklisting add a - to the beginning of the domain string.
- Example:
```yaml
perplexity_search_domain_filter:
- spice.ai
- docs.perplexity.ai
```
- `perplexity_search_recency_filter`: Returns search results within the specified time interval - does not apply to images. One of: `month`, `week`, `day`, `hour`.
12 changes: 12 additions & 0 deletions website/docs/reference/spicepod/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ Tools define functions that can be invoked within the Spice runtime, either dire

The `tools` section in your configuration specifies one or more tools available for use in the runtime.

Example:

```yaml
tools:
- name: arpanet
from: websearch
description: "Search the web for information."
params:
engine: perplexity
perplexity_auth_token: ${ secrets:SPICE_PERPLEXITY_AUTH_TOKEN }
```

### `name`

A unique identifier for this tool.
Expand Down
Loading