Feature request: Adding temperature as parameter (#513)
* Adding temperature as parameter * NEXT_PUBLIC_ prefix added * add spacing --------- Co-authored-by: Ivan Fioravanti <> Co-authored-by: Mckay Wrigley <mckaywrigley@gmail.com>
This commit is contained in:
+12
-1
@@ -1,7 +1,7 @@
|
||||
import { Conversation } from '@/types/chat';
|
||||
import { OpenAIModelID, OpenAIModels } from '@/types/openai';
|
||||
|
||||
import { DEFAULT_SYSTEM_PROMPT } from './const';
|
||||
import { DEFAULT_SYSTEM_PROMPT, DEFAULT_TEMPERATURE } from './const';
|
||||
|
||||
export const cleanSelectedConversation = (conversation: Conversation) => {
|
||||
// added model for each conversation (3/20/23)
|
||||
@@ -27,6 +27,13 @@ export const cleanSelectedConversation = (conversation: Conversation) => {
|
||||
};
|
||||
}
|
||||
|
||||
if (!updatedConversation.temperature) {
|
||||
updatedConversation = {
|
||||
...updatedConversation,
|
||||
temperature: updatedConversation.temperature || DEFAULT_TEMPERATURE,
|
||||
};
|
||||
}
|
||||
|
||||
if (!updatedConversation.folderId) {
|
||||
updatedConversation = {
|
||||
...updatedConversation,
|
||||
@@ -58,6 +65,10 @@ export const cleanConversationHistory = (history: any[]): Conversation[] => {
|
||||
conversation.prompt = DEFAULT_SYSTEM_PROMPT;
|
||||
}
|
||||
|
||||
if (!conversation.temperature) {
|
||||
conversation.temperature = DEFAULT_TEMPERATURE;
|
||||
}
|
||||
|
||||
if (!conversation.folderId) {
|
||||
conversation.folderId = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user