Trae Assistant commited on
Commit
5db8244
·
1 Parent(s): 69a3dd3

fix: Restore API Key prompt and fix unused imports

Browse files
Files changed (1) hide show
  1. src/services/chatService.ts +8 -2
src/services/chatService.ts CHANGED
@@ -142,8 +142,14 @@ export const chatService = {
142
  },
143
 
144
  async sendMessage(messages: Message[], onChunk: (content: string) => void, signal?: AbortSignal): Promise<void> {
145
- const apiKey = this.getApiKey();
146
- // Removed API Key prompt as requested
 
 
 
 
 
 
147
 
148
  try {
149
  const response = await fetch(API_URL, {
 
142
  },
143
 
144
  async sendMessage(messages: Message[], onChunk: (content: string) => void, signal?: AbortSignal): Promise<void> {
145
+ let apiKey = this.getApiKey();
146
+ if (!apiKey) {
147
+ const input = prompt('Please enter your SiliconFlow API Key:');
148
+ if (input) {
149
+ this.setApiKey(input);
150
+ apiKey = input;
151
+ }
152
+ }
153
 
154
  try {
155
  const response = await fetch(API_URL, {