Skip to content

Commit

Permalink
add xai
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydzhou committed Oct 23, 2024
1 parent 8455fef commit e791cd4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/api/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export function auth(req: NextRequest, modelProvider: ModelProvider) {
}

if (systemApiKey) {
console.log("[Auth] use system api key", systemApiKey);
console.log("[Auth] use system api key");
req.headers.set("Authorization", `Bearer ${systemApiKey}`);
} else {
console.log("[Auth] admin did not provide an api key");
Expand Down
4 changes: 1 addition & 3 deletions app/client/platforms/xai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,9 @@ export class XAIApi implements LLMApi {
presence_penalty: modelConfig.presence_penalty,
frequency_penalty: modelConfig.frequency_penalty,
top_p: modelConfig.top_p,
// max_tokens: Math.max(modelConfig.max_tokens, 1024),
// Please do not ask me why not send max_tokens, no reason, this param is just shit, I dont want to explain anymore.
};

console.log("[Request] openai payload: ", requestPayload);
console.log("[Request] xai payload: ", requestPayload);

const shouldStream = !!options.config.stream;
const controller = new AbortController();
Expand Down
2 changes: 1 addition & 1 deletion app/store/access.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const DEFAULT_ACCESS_STATE = {
iflytekApiKey: "",
iflytekApiSecret: "",

// moonshot
// xai
xaiUrl: DEFAULT_XAI_URL,
xaiApiKey: "",

Expand Down

0 comments on commit e791cd4

Please sign in to comment.