forked from XiaoMo/ChatGPT-Next-Web
Merge pull request #708 from peanut996/patch-1
[refactor] rename ChatResponse.
This commit is contained in:
commit
b4cea45bfe
@ -4,4 +4,4 @@ import type {
|
|||||||
} from "openai";
|
} from "openai";
|
||||||
|
|
||||||
export type ChatRequest = CreateChatCompletionRequest;
|
export type ChatRequest = CreateChatCompletionRequest;
|
||||||
export type ChatReponse = CreateChatCompletionResponse;
|
export type ChatResponse = CreateChatCompletionResponse;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { ChatRequest, ChatReponse } from "./api/openai/typing";
|
import type { ChatRequest, ChatResponse } from "./api/openai/typing";
|
||||||
import { Message, ModelConfig, useAccessStore, useChatStore } from "./store";
|
import { Message, ModelConfig, useAccessStore, useChatStore } from "./store";
|
||||||
import { showToast } from "./components/ui-lib";
|
import { showToast } from "./components/ui-lib";
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ export async function requestChat(messages: Message[]) {
|
|||||||
const res = await requestOpenaiClient("v1/chat/completions")(req);
|
const res = await requestOpenaiClient("v1/chat/completions")(req);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = (await res.json()) as ChatReponse;
|
const response = (await res.json()) as ChatResponse;
|
||||||
return response;
|
return response;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("[Request Chat] ", error, res.body);
|
console.error("[Request Chat] ", error, res.body);
|
||||||
|
Loading…
Reference in New Issue
Block a user