Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add README.md files for the plugins. #2474

Merged
merged 2 commits into from
Sep 26, 2024
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
5 changes: 4 additions & 1 deletion .github/workflows/ci_plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ jobs:
for file in "${changed_files[@]}"; do
if [[ "$file" =~ ^plugins/ && ! "$file" =~ ^plugins/template/ ]]; then
plugin_name=$(echo "$file" | cut -d '/' -f 2)
plugin_set[$plugin_name]=1
# Check if the plugin has a pyproject.toml file
if [[ -f "plugins/$plugin_name/pyproject.toml" ]]; then
plugin_set[$plugin_name]=1
fi
fi
done
plugins=("${!plugin_set[@]}")
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix the issue where MongoDB did not create the output table.
- Fix the bug in the CI where plugins are skipping tests.
- Updated CONTRIBUTING.md
- Add README.md files for the plugins.

#### New Features & Functionality

Expand Down
5 changes: 5 additions & 0 deletions plugins/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Superduper plugins

Superduper plugins are a collection of plugins that provide additional functionality to the Superduper framework.

These plugins are designed to be easily integrated into the Superduper framework, and provide additional functionality to the Superduper framework.
41 changes: 41 additions & 0 deletions plugins/anthropic/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!-- Auto-generated content start -->
# superduper_anthropic

Superduper allows users to work with anthropic API models. The key integration is the integration of high-quality API-hosted LLM services.

## Installation

```bash
pip install superduper_anthropic
```

## API


- [Code](https://github.com/superduper-io/superduper/tree/main/plugins/anthropic)
- [API-docs](/docs/api/plugins/superduper_anthropic)

| Class | Description |
|---|---|
| `superduper_anthropic.model.Anthropic` | Anthropic predictor. |
| `superduper_anthropic.model.AnthropicCompletions` | Cohere completions (chat) predictor. |


## Examples

### AnthropicCompletions

```python
from superduper_anthropic.model import AnthropicCompletions

model = AnthropicCompletions(
identifier="claude-2.1",
predict_kwargs={"max_tokens": 64},
)
model.predict_batches(["Hello, world!"])
```


<!-- Auto-generated content end -->

<!-- Add your additional content below -->
1 change: 1 addition & 0 deletions plugins/anthropic/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "superduper_anthropic"
readme = "README.md"
description = "Superduper allows users to work with anthropic API models. The key integration is the integration of high-quality API-hosted LLM services."
license = {file = "LICENSE"}
maintainers = [{name = "superduper.io, Inc.", email = "opensource@superduper.io"}]
keywords = [
Expand Down
11 changes: 11 additions & 0 deletions plugins/anthropic/superduper_anthropic/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ class AnthropicCompletions(Anthropic):
"""Cohere completions (chat) predictor.

:param prompt: The prompt to use to seed the response.

Example:
-------
>>> from superduper_anthropic.model import AnthropicCompletions
>>>
>>> model = AnthropicCompletions(
>>> identifier="claude-2.1",
>>> predict_kwargs={"max_tokens": 64},
>>> )
>>> model.predict_batches(["Hello, world!"])

"""

prompt: str = ''
Expand Down
46 changes: 46 additions & 0 deletions plugins/cohere/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!-- Auto-generated content start -->
# superduper_cohere

Superduper allows users to work with cohere API models.

## Installation

```bash
pip install superduper_cohere
```

## API


- [Code](https://github.com/superduper-io/superduper/tree/main/plugins/cohere)
- [API-docs](/docs/api/plugins/superduper_cohere)

| Class | Description |
|---|---|
| `superduper_cohere.model.Cohere` | Cohere predictor. |
| `superduper_cohere.model.CohereEmbed` | Cohere embedding predictor. |
| `superduper_cohere.model.CohereGenerate` | Cohere realistic text generator (chat predictor). |


## Examples

### CohereEmbed

```python
from superduper_cohere.model import CohereEmbed
model = CohereEmbed(identifier='embed-english-v2.0', batch_size=1)
model..predict('Hello world')
```

### CohereGenerate

```python
from superduper_cohere.model import CohereGenerate
model = CohereGenerate(identifier='base-light', prompt='Hello, {context}')
model.predict('', context=['world!'])
```


<!-- Auto-generated content end -->

<!-- Add your additional content below -->
1 change: 1 addition & 0 deletions plugins/cohere/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "superduper_cohere"
readme = "README.md"
description = "Superduper allows users to work with cohere API models."
license = {file = "LICENSE"}
maintainers = [{name = "superduper.io, Inc.", email = "opensource@superduper.io"}]
keywords = [
Expand Down
14 changes: 14 additions & 0 deletions plugins/cohere/superduper_cohere/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ class CohereEmbed(Cohere):

:param shape: The shape as ``tuple`` of the embedding.
:param batch_size: The batch size to use for the predictor.

Example:
-------
>>> from superduper_cohere.model import CohereEmbed
>>> model = CohereEmbed(identifier='embed-english-v2.0', batch_size=1)
>>> model..predict('Hello world')

"""

shapes: t.ClassVar[t.Dict] = {'embed-english-v2.0': (4096,)}
Expand Down Expand Up @@ -94,6 +101,13 @@ class CohereGenerate(Cohere):

:param takes_context: Whether the model takes context into account.
:param prompt: The prompt to use to seed the response.

Example:
-------
>>> from superduper_cohere.model import CohereGenerate
>>> model = CohereGenerate(identifier='base-light', prompt='Hello, {context}')
>>> model.predict('', context=['world!'])

"""

signature: str = '*args,**kwargs'
Expand Down
Loading
Loading