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

Remove Legacy OpenAiChatCompletionPromptDriver #835

Merged
merged 1 commit into from
Jun 6, 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **BREAKING**: Removed `BedrockJurassicTokenizer`, use `SimpleTokenizer` instead.
- **BREAKING**: Removed `BedrockLlamaTokenizer`, use `SimpleTokenizer` instead.
- **BREAKING**: Removed `BedrockTitanTokenizer`, use `SimpleTokenizer` instead.
- **BREAKING**: Removed `OpenAiChatCompletionPromptDriver` as it uses the legacy [OpenAi Completions API](https://platform.openai.com/docs/api-reference/completions).
- Updated `AmazonBedrockPromptDriver` to use [Converse API](https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html).
- `Structure.before_run()` now automatically resolves asymmetrically defined parent/child relationships using the new `Structure.resolve_relationships()`.
- Updated `HuggingFaceHubPromptDriver` to use `transformers`'s `apply_chat_template`.
Expand Down
32 changes: 0 additions & 32 deletions docs/griptape-framework/drivers/prompt-drivers.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,38 +125,6 @@ agent = Agent(
agent.run("Artificial intelligence is a technology with great promise.")
```

### Azure OpenAI Completion

The [AzureOpenAiCompletionPromptDriver](../../reference/griptape/drivers/prompt/azure_openai_completion_prompt_driver.md) connects to Azure OpenAI [Text Completion](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/reference) API.

```python
import os
from griptape.structures import Agent
from griptape.drivers import AzureOpenAiCompletionPromptDriver
from griptape.config import StructureConfig

agent = Agent(
config=StructureConfig(
prompt_driver=AzureOpenAiCompletionPromptDriver(
api_key=os.environ["AZURE_OPENAI_API_KEY_1"],
model="text-davinci-003",
azure_deployment=os.environ["AZURE_OPENAI_DAVINCI_DEPLOYMENT_ID"],
azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT_1"],
temperature=1
)
)
)

agent.run(
"""
Write a product launch email for new AI-powered headphones that are priced at $79.99 and available at Best Buy, Target and Amazon.com. The target audience is tech-savvy music lovers and the tone is friendly and exciting.

1. What should be the subject line of the email?
2. What should be the body of the email?
"""
)
```

### Cohere

The [CoherePromptDriver](../../reference/griptape/drivers/prompt/cohere_prompt_driver.md) connects to the Cohere [Generate](https://docs.cohere.ai/reference/generate) API.
Expand Down
4 changes: 0 additions & 4 deletions griptape/drivers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from .prompt.base_prompt_driver import BasePromptDriver
from .prompt.openai_chat_prompt_driver import OpenAiChatPromptDriver
from .prompt.openai_completion_prompt_driver import OpenAiCompletionPromptDriver
from .prompt.azure_openai_chat_prompt_driver import AzureOpenAiChatPromptDriver
from .prompt.azure_openai_completion_prompt_driver import AzureOpenAiCompletionPromptDriver
from .prompt.cohere_prompt_driver import CoherePromptDriver
from .prompt.huggingface_pipeline_prompt_driver import HuggingFacePipelinePromptDriver
from .prompt.huggingface_hub_prompt_driver import HuggingFaceHubPromptDriver
Expand Down Expand Up @@ -112,9 +110,7 @@
__all__ = [
"BasePromptDriver",
"OpenAiChatPromptDriver",
"OpenAiCompletionPromptDriver",
"AzureOpenAiChatPromptDriver",
"AzureOpenAiCompletionPromptDriver",
"CoherePromptDriver",
"HuggingFacePipelinePromptDriver",
"HuggingFaceHubPromptDriver",
Expand Down
41 changes: 0 additions & 41 deletions griptape/drivers/prompt/azure_openai_completion_prompt_driver.py

This file was deleted.

83 changes: 0 additions & 83 deletions griptape/drivers/prompt/openai_completion_prompt_driver.py

This file was deleted.

This file was deleted.

112 changes: 0 additions & 112 deletions tests/unit/drivers/prompt/test_openai_completion_prompt_driver.py

This file was deleted.

Loading
Loading