#ai_task take the picture file instead of camera media

1 messages · Page 1 of 1 (latest)

zenith crag
#

I would like to use the image file when asking AI task to analyze it. I am able to:

  • create a snapshot and save it (verified and I see picture nicely)
  • Ask AI task to analyze it with GPT-4o mode, but the media is taken from camera, not from the previously captured file.

How should I change the attachment part, since I don't seem to find any proper solution on the internet, that works with the ai_task.generate_data

My actions looks like this:

actions:
  - action: camera.snapshot
    metadata: {}
    data:
      filename: ./www/snapshots/camera1_snapshot.jpg
    target:
      entity_id: camera.test_camera
  - action: ai_task.generate_data
    data:
      task_name: Analyze the snapshot
      instructions: >-
        Review the .... long list of instructions
      entity_id: ai_task.openai_ai_task
      attachments:
        media_content_id: media-source://camera/camera.test_camera
        media_content_type: image/jpeg
    response_variable: result

Target is that attachement is the ./www/snapshots/camera1_snapshot.jpg rather than media-source://camera/camera.test_camera