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

Updates AI plugin #5227

Merged
merged 3 commits into from
Sep 19, 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
8 changes: 3 additions & 5 deletions src/dispatch/plugins/bases/artificial_intelligence.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Marc Vilanova <mvilanova@netflix.com>
"""

from dispatch.plugins.base import Plugin


class ArtificialIntelligencePlugin(Plugin):
type = "artificial-intelligence"

def chat(self, items, **kwargs):
raise NotImplementedError

def completion(self, items, **kwargs):
def chat_completion(self, items, **kwargs):
raise NotImplementedError

def summarization(self, items, **kwargs):
def list_models(self, items, **kwargs):
raise NotImplementedError
2 changes: 1 addition & 1 deletion src/dispatch/plugins/dispatch_openai/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class OpenAIConfiguration(BaseConfigurationModel):

api_key: SecretStr = Field(title="API Key", description="Your secret OpenAI API key.")
model: str = Field(
"gpt-3.5-turbo",
"gpt-4o",
title="Model",
description="Available models can be found at https://platform.openai.com/docs/models",
)
Expand Down
2 changes: 1 addition & 1 deletion src/dispatch/plugins/dispatch_openai/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class OpenAIPlugin(ArtificialIntelligencePlugin):
def __init__(self):
self.configuration_schema = OpenAIConfiguration

def completion(self, prompt: str) -> dict:
def chat_completion(self, prompt: str) -> dict:
client = OpenAI(api_key=self.api_key)

try:
Expand Down
Loading