Skip to content

Add support for image processing #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

shaywiin
Copy link

No description provided.

@ericc-ch ericc-ch requested a review from Copilot July 18, 2025 13:34
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for image processing by updating the Anthropic tool result content types and modifying the message handling logic to properly process mixed content types (text and images). It also includes version updates and configuration changes.

  • Expanded AnthropicToolResultBlock content type to support arrays of text and image blocks
  • Reordered tool result processing in message handling and updated content mapping
  • Updated API versions and simplified base URL configuration

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/routes/messages/anthropic-types.ts Expanded tool result content type to support image blocks
src/routes/messages/non-stream-translation.ts Reordered tool result processing and updated content mapping
src/lib/api-config.ts Updated versions and simplified URL configuration
src/start.ts Added hostname binding configuration
package.json Updated dev script with start argument

Comment on lines 16 to +17
export const copilotBaseUrl = (state: State) =>
state.accountType === "individual" ?
"https://api.githubcopilot.com"
: `https://api.${state.accountType}.githubcopilot.com`
`https://api.${state.accountType}.githubcopilot.com`
Copy link
Preview

Copilot AI Jul 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The simplified URL configuration removes the special case for 'individual' account types. This could break existing functionality if individual accounts require the 'api.githubcopilot.com' endpoint instead of 'api.individual.githubcopilot.com'.

Copilot uses AI. Check for mistakes.

@@ -99,6 +99,7 @@ export async function runServer(options: RunServerOptions): Promise<void> {
)

serve({
hostname: "0.0.0.0",
Copy link
Preview

Copilot AI Jul 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Binding to '0.0.0.0' exposes the server to all network interfaces, which may introduce security risks if the server is intended for localhost development only. Consider using '127.0.0.1' or making this configurable.

Suggested change
hostname: "0.0.0.0",
hostname: options.hostname || "127.0.0.1", // Use configurable hostname with default

Copilot uses AI. Check for mistakes.

@ericc-ch
Copy link
Owner

I forgot to say, thanks for making a pr!
Btw can you fix the review made by copilot?
I haven't thoroughly test the pr but those ones can break things

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants