@jeffreycao/copilot-api 1.5.3-beta.2 → 1.5.3-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -23,7 +23,7 @@ if (typeof args["enterprise-url"] === "string") process.env.COPILOT_API_ENTERPRI
23
23
  const { auth } = await import("./auth-DqeBalDi.js");
24
24
  const { checkUsage } = await import("./check-usage-BCT4zrbb.js");
25
25
  const { debug } = await import("./debug-DcC7ZPH0.js");
26
- const { start } = await import("./start-BBCMQ5y3.js");
26
+ const { start } = await import("./start-CrNDSGP_.js");
27
27
  const main = defineCommand({
28
28
  meta: {
29
29
  name: "copilot-api",
@@ -1888,7 +1888,10 @@ const buildAnthropicBetaHeader = (anthropicBetaHeader, thinking) => {
1888
1888
  };
1889
1889
  const createMessages = async (payload, anthropicBetaHeader, options) => {
1890
1890
  if (!state.copilotToken) throw new Error("Copilot token not found");
1891
- const enableVision = payload.messages.some((message) => Array.isArray(message.content) && message.content.some((block) => block.type === "image"));
1891
+ const enableVision = payload.messages.some((message) => {
1892
+ if (!Array.isArray(message.content)) return false;
1893
+ return message.content.some((block) => block.type === "image" || block.type === "tool_result" && Array.isArray(block.content) && block.content.some((inner) => inner.type === "image"));
1894
+ });
1892
1895
  let isInitiateRequest = false;
1893
1896
  const lastMessage = payload.messages.at(-1);
1894
1897
  if (lastMessage?.role === "user") isInitiateRequest = Array.isArray(lastMessage.content) ? lastMessage.content.some((block) => block.type !== "tool_result") : true;
@@ -2976,4 +2979,4 @@ server.route("/:provider/v1/models", providerModelRoutes);
2976
2979
 
2977
2980
  //#endregion
2978
2981
  export { server };
2979
- //# sourceMappingURL=server-DP3qGqqy.js.map
2982
+ //# sourceMappingURL=server-DLaz3q72.js.map