@blueharford/scrypted-spatial-awareness 0.6.10 → 0.6.11

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/plugin.zip CHANGED
Binary file
@@ -35137,54 +35137,23 @@ async function mediaObjectToBase64(mediaObject) {
35137
35137
  }
35138
35138
  /**
35139
35139
  * Build image content block for ChatCompletion API
35140
- * Supports OpenAI, Anthropic, and @scrypted/llm formats
35140
+ *
35141
+ * IMPORTANT: @scrypted/llm uses OpenAI-compatible format for ALL providers.
35142
+ * The plugin internally converts this format to the appropriate provider format.
35143
+ * So we ALWAYS use the OpenAI image_url format with data URI.
35144
+ *
35141
35145
  * @param imageData - Image data with base64 and media type
35142
- * @param provider - The LLM provider type
35146
+ * @param provider - The LLM provider type (currently unused, kept for logging)
35143
35147
  */
35144
35148
  function buildImageContent(imageData, provider = 'unknown') {
35145
- if (provider === 'openai') {
35146
- // OpenAI format: uses data URL with image_url wrapper
35147
- return {
35148
- type: 'image_url',
35149
- image_url: {
35150
- url: `data:${imageData.mediaType};base64,${imageData.base64}`,
35151
- detail: 'auto',
35152
- },
35153
- };
35154
- }
35155
- else if (provider === 'anthropic') {
35156
- // Anthropic official format: uses 'data' key
35157
- return {
35158
- type: 'image',
35159
- source: {
35160
- type: 'base64',
35161
- media_type: imageData.mediaType,
35162
- data: imageData.base64,
35163
- },
35164
- };
35165
- }
35166
- else if (provider === 'scrypted') {
35167
- // @scrypted/llm format: uses 'base64' key (per error path .image.source.base64)
35168
- return {
35169
- type: 'image',
35170
- source: {
35171
- type: 'base64',
35172
- media_type: imageData.mediaType,
35173
- base64: imageData.base64,
35174
- },
35175
- };
35176
- }
35177
- else {
35178
- // Unknown provider: try @scrypted/llm format first
35179
- return {
35180
- type: 'image',
35181
- source: {
35182
- type: 'base64',
35183
- media_type: imageData.mediaType,
35184
- base64: imageData.base64,
35185
- },
35186
- };
35187
- }
35149
+ // @scrypted/llm uses OpenAI-compatible format for ALL providers
35150
+ // The plugin handles internal conversion to Anthropic/other formats
35151
+ return {
35152
+ type: 'image_url',
35153
+ image_url: {
35154
+ url: `data:${imageData.mediaType};base64,${imageData.base64}`,
35155
+ },
35156
+ };
35188
35157
  }
35189
35158
  /** Check if an error indicates vision/multimodal content format issue (should try alternate format) */
35190
35159
  function isVisionFormatError(error) {