-
Notifications
You must be signed in to change notification settings - Fork 0
Maintenance #23
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
Maintenance #23
Changes from all commits
b29788e
37e2398
8d8e104
f060fa6
dd370d5
844eb31
af92057
be7d07c
5e923e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| export interface SignUp { | ||
| token: string; | ||
| access: string; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -363,7 +363,7 @@ export class OpenaiChatbotService { | |
| const answer = await this.openaiService.getChatGptCompletion( | ||
| { | ||
| messages: messages as any, | ||
| temperature: 0.1, | ||
| temperature: 1, | ||
| frequency_penalty: 0, | ||
| presence_penalty: 0, | ||
| top_p: 1, | ||
|
|
@@ -401,7 +401,7 @@ export class OpenaiChatbotService { | |
| const answerStream = await this.openaiService.getChatGptCompletionStream( | ||
| { | ||
| messages: messages, | ||
| temperature: 0, | ||
| temperature: 1, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| frequency_penalty: 0, | ||
| presence_penalty: 0, | ||
| stream: true, | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -163,7 +163,7 @@ export class OpenaiService { | |||||
| data: OpenAI.Chat.ChatCompletionCreateParams, | ||||||
| openAiClient: OpenAI, | ||||||
| ): Promise<string> { | ||||||
| const input = JSON.stringify(data.messages.slice(1)) | ||||||
| const input = JSON.stringify(data.messages.slice(1)); | ||||||
| const prompt = ` | ||||||
| The chat history is: "${input}". | ||||||
| Determine whether any content in the chat history relates to package tracking or tracking numbers (e.g., questions about shipments, delivery, or tracking numbers) or address (e.g., questions about pickup address relative to user address). | ||||||
|
|
@@ -177,7 +177,7 @@ export class OpenaiService { | |||||
| const response = await openAiClient.chat.completions.create({ | ||||||
| model: data.model, // Or use another model | ||||||
| messages: [{ role: 'system', content: prompt }], | ||||||
| temperature: 0, // To make the response more deterministic | ||||||
| temperature: 1, // To make the response more deterministic | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Increasing the
Suggested change
|
||||||
| }); | ||||||
|
|
||||||
| const result = response.choices[0]?.message?.content?.trim(); | ||||||
|
|
@@ -267,7 +267,7 @@ export class OpenaiService { | |||||
|
|
||||||
| async implementApiCalls( | ||||||
| analyzedInput: string, | ||||||
| data: OpenAI.Chat.ChatCompletionCreateParams | ||||||
| data: OpenAI.Chat.ChatCompletionCreateParams, | ||||||
| ) { | ||||||
| const addressObject = this.getAddress(analyzedInput); | ||||||
| const pakkeshopData = await this.fetchPakkeshopInformation(addressObject); | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Increasing the
temperatureto1will make the chatbot's responses highly random and non-deterministic. For a knowledge-based chatbot that should provide factual and consistent answers, a lower temperature (close to 0) is generally recommended. Please consider if this change is intended, as it will significantly alter the chatbot's behavior.