MCPcopy
hub / github.com/ChatGPTNextWeb/NextChat / path

Method path

app/client/platforms/alibaba.ts:62–86  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

60
61export class QwenApi implements LLMApi {
62 path(path: string): string {
63 const accessStore = useAccessStore.getState();
64
65 let baseUrl = "";
66
67 if (accessStore.useCustomConfig) {
68 baseUrl = accessStore.alibabaUrl;
69 }
70
71 if (baseUrl.length === 0) {
72 const isApp = !!getClientConfig()?.isApp;
73 baseUrl = isApp ? ALIBABA_BASE_URL : ApiPath.Alibaba;
74 }
75
76 if (baseUrl.endsWith("/")) {
77 baseUrl = baseUrl.slice(0, baseUrl.length - 1);
78 }
79 if (!baseUrl.startsWith("http") && !baseUrl.startsWith(ApiPath.Alibaba)) {
80 baseUrl = "https://" + baseUrl;
81 }
82
83 console.log("[Proxy Endpoint] ", baseUrl, path);
84
85 return [baseUrl, path].join("/");
86 }
87
88 extractMessage(res: any) {
89 return res?.output?.choices?.at(0)?.message?.content ?? "";

Callers 1

chatMethod · 0.95

Calls 1

getClientConfigFunction · 0.90

Tested by

no test coverage detected