Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
snakeying authored Oct 10, 2024
1 parent 560732e commit 838c4ae
Show file tree
Hide file tree
Showing 12 changed files with 224 additions and 102 deletions.
2 changes: 1 addition & 1 deletion dist/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
This folder contains the built output assets for the worker "gpt-telegram-worker" generated at 2024-10-09T20:27:42.863Z.
This folder contains the built output assets for the worker "gpt-telegram-worker" generated at 2024-10-10T06:26:20.658Z.
135 changes: 96 additions & 39 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions dist/index.js.map

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions src/api/claude.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export class ClaudeAPI implements ModelAPIInterface {

async generateResponse(messages: Message[], model?: string): Promise<string> {
const useModel = model || this.defaultModel;
console.log(`Generating response with Claude model: ${useModel}`);
const url = `${this.baseUrl}/messages`;

const response = await fetch(url, {
Expand All @@ -51,12 +50,10 @@ export class ClaudeAPI implements ModelAPIInterface {
}

const data: ClaudeResponse = await response.json();
console.log('Claude API response received');
if (!data.content || data.content.length === 0) {
throw new Error('No response generated from Claude API');
}
const generatedText = data.content[0].text.trim();
console.log(`Generated text length: ${generatedText.length}`);
return generatedText;
}

Expand Down
1 change: 0 additions & 1 deletion src/api/flux-cf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ export class FluxAPI implements ModelAPIInterface {
}

if (!data.result || !data.result.image) {
console.error('Flux API returned no image');
throw new Error('Flux API returned no image');
}

Expand Down
Loading

0 comments on commit 838c4ae

Please sign in to comment.