mirror of
https://github.com/sqlchat/sqlchat.git
synced 2025-09-27 01:56:16 +08:00
Add Deepseek Chat support and fix query results display (#179)
This commit is contained in:
@ -43,6 +43,13 @@ const OpenAIApiConfigView = () => {
|
|||||||
disabled: false,
|
disabled: false,
|
||||||
tooltip: "",
|
tooltip: "",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: "deepseek-chat",
|
||||||
|
title: `Deepseek Chat`,
|
||||||
|
cost: 1,
|
||||||
|
disabled: false,
|
||||||
|
tooltip: "",
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const maskedKey = (str: string) => {
|
const maskedKey = (str: string) => {
|
||||||
|
@ -4,7 +4,8 @@ export const getMessageFromExecutionResult = (result: ExecutionResult): string =
|
|||||||
if (result.error) {
|
if (result.error) {
|
||||||
return result.error;
|
return result.error;
|
||||||
}
|
}
|
||||||
if (result.affectedRows) {
|
// Only return the "rows affected" message if there are no raw results to display
|
||||||
|
if (result.affectedRows && (!result.rawResult || result.rawResult.length === 0)) {
|
||||||
return `${result.affectedRows} rows affected.`;
|
return `${result.affectedRows} rows affected.`;
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
|
@ -34,7 +34,16 @@ const gpt4ho = {
|
|||||||
cost_per_call: 10,
|
cost_per_call: 10,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const models = [gpt35turbo, gpt4, gpt4turbo, gpt4ho];
|
const deepseekChat = {
|
||||||
|
name: "deepseek-chat",
|
||||||
|
temperature: 0,
|
||||||
|
frequency_penalty: 0.0,
|
||||||
|
presence_penalty: 0.0,
|
||||||
|
max_token: 12000,
|
||||||
|
cost_per_call: 1,
|
||||||
|
};
|
||||||
|
|
||||||
|
export const models = [gpt35turbo, gpt4, gpt4turbo, gpt4ho, deepseekChat];
|
||||||
|
|
||||||
export const getModel = (name: string) => {
|
export const getModel = (name: string) => {
|
||||||
for (const model of models) {
|
for (const model of models) {
|
||||||
|
Reference in New Issue
Block a user