-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
22 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,19 @@ | ||
from pydantic import Field, SecretStr | ||
from typing import List, TypeVar | ||
|
||
from dispatch.config import BaseConfigurationModel | ||
|
||
Stop = TypeVar("Stop", str, List) | ||
|
||
|
||
class OpenAIConfiguration(BaseConfigurationModel): | ||
"""OpenAI configuration description.""" | ||
|
||
api_key: SecretStr = Field(title="API Key", description="Your secret OpenAI API key.") | ||
model: str = Field("text-davinci-003", title="Model", description="") | ||
max_tokens: int = Field( | ||
50, | ||
title="Max Tokens", | ||
description="The maximum number of tokens to generate in the completion.", | ||
) | ||
temperature: float = Field( | ||
1, title="Temperature", description="What sampling temperature to use, between 0 and 2." | ||
) | ||
n: int = Field( | ||
1, | ||
title="Number of completions (n)", | ||
description="How many completions to generate for each prompt.", | ||
model: str = Field( | ||
"gpt-3.5-turbo", | ||
title="Model", | ||
description="Available models can be found at https://platform.openai.com/docs/models", | ||
) | ||
stop: Stop = Field( | ||
None, | ||
title="Stop", | ||
description="Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.", | ||
system_message: str = Field( | ||
"You are a helpful assistant.", | ||
title="System Message", | ||
description="The system message to help set the behavior of the assistant.", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters