update
This commit is contained in:
@@ -9,7 +9,10 @@ export class ChatGPTService {
|
||||
}
|
||||
return this._instance;
|
||||
}
|
||||
|
||||
private id = "";
|
||||
public GetId() {
|
||||
return this.id;
|
||||
}
|
||||
private apiurl: string = "https://cloud.fastgpt.cn/api/v1/chat/completions";
|
||||
private apikey: string =
|
||||
"fastgpt-gZSIl62Oznoqirj4zrs8tuvYH8Yk9C7GaOiOQtIh6UdLfup7QW2zSWS3";
|
||||
@@ -24,6 +27,7 @@ export class ChatGPTService {
|
||||
if (response) {
|
||||
const d = JSON.parse(response);
|
||||
resolve(d);
|
||||
ChatGPTService.getInstance().id = d.id;
|
||||
} else {
|
||||
resolve(null);
|
||||
}
|
||||
@@ -41,6 +45,7 @@ export type GPTResquest = {
|
||||
model: string; //gpt-3.5-turbo
|
||||
messages: { role: string; content: string }[];
|
||||
temperature: number;
|
||||
id: string;
|
||||
};
|
||||
export type GPTResult = {
|
||||
id: string;
|
||||
|
||||
@@ -26,7 +26,9 @@ export class ChatPanel extends Component {
|
||||
model: "Deepseek-reasoner",
|
||||
messages: [{ role: "user", content: str }],
|
||||
temperature: 0.8,
|
||||
id: ChatGPTService.getInstance().GetId(),
|
||||
});
|
||||
console.log(ret);
|
||||
|
||||
const rep = ret.choices[0].message.content;
|
||||
if (rep == null) {
|
||||
|
||||
Reference in New Issue
Block a user