Git Product home page Git Product logo

Comments (4)

gehrisandro avatar gehrisandro commented on June 12, 2024 2

Support for vision added in the latest release: https://github.com/openai-php/client/releases/tag/v0.7.8

from laravel.

carestad avatar carestad commented on June 12, 2024 1

I am seeing this too. The problem is most likely in https://github.com/openai-php/client though and not the Laravel package I think.

from laravel.

ThibautPV avatar ThibautPV commented on June 12, 2024

The problem is that Vision doesn't have a "finish_reason" key, but a "finish_details" key.

Here is the return of "$response" in the "create" function

  ["data":"OpenAI\ValueObjects\Transporter\Response":private]=>
  array(6) {
    ["id"]=>
    string(38) "chatcmpl-8IDwyCPKagOULoujiDqvNXssfs1s"
    ["object"]=>
    string(15) "chat.completion"
    ["created"]=>
    int(1699354220)
    ["model"]=>
    string(25) "gpt-4-1106-vision-preview"
    ["usage"]=>
    array(3) {
      ["prompt_tokens"]=>
      int(1114)
      ["completion_tokens"]=>
      int(184)
      ["total_tokens"]=>
      int(1298)
    }
    ["choices"]=>
    array(1) {
      [0]=>
      array(3) {
        ["message"]=>
        array(2) {
          ["role"]=>
          string(9) "assistant"
          ["content"]=>
          string(942) "This is an image of a wooden boardwalk traversing through a lush green field. The boardwalk is constructed with horizontal planks and has a simple design without handrails or barriers. It extends from the foreground into the middle of the image, guiding the viewer's eye towards the horizon. On either side of the walkway, tall green grasses are visible, suggesting the boardwalk is meant to protect the natural environment and provide a path for visitors to enjoy without disturbing the surrounding flora.

The sky is a vibrant blue with wispy white clouds scattered throughout, suggesting a fair weather day. In the distance, there's a line of trees or shrubs, dividing the grassy field from the sky. The natural lighting and composition give the scene a serene and inviting atmosphere, ideal for a peaceful walk or nature observation. The combination of the verdant fields and the expansive sky creates a sense of openness and tranquility."
        }
        ["finish_details"]=>
        array(2) {
          ["type"]=>
          string(4) "stop"
          ["stop"]=>
          string(14) "<|fim_suffix|>"
        }
        ["index"]=>
        int(0)
      }
    }
  }
  ["meta":"OpenAI\ValueObjects\Transporter\Response":private]=>
  object(OpenAI\Responses\Meta\MetaInformation)#331 (4) {
    ["requestId"]=>
    string(32) "22736336820a8a74cf0b5c3e91319a42"
    ["openai"]=>
    object(OpenAI\Responses\Meta\MetaInformationOpenAI)#322 (4) {
      ["model"]=>
      NULL
      ["organization"]=>
      string(9) "my-organization"
      ["version"]=>
      string(10) "2020-10-01"
      ["processingMs"]=>
      int(5843)
    }
    ["requestLimit"]=>
    object(OpenAI\Responses\Meta\MetaInformationRateLimit)#334 (3) {
      ["limit"]=>
      int(100)
      ["remaining"]=>
      int(93)
      ["reset"]=>
      string(11) "1h37m5.049s"
    }
    ["tokenLimit"]=>
    object(OpenAI\Responses\Meta\MetaInformationRateLimit)#323 (3) {
      ["limit"]=>
      int(40000)
      ["remaining"]=>
      int(39095)
      ["reset"]=>
      string(6) "1.357s"
    }
  }
}```

from laravel.

ThibautPV avatar ThibautPV commented on June 12, 2024

Files to be modified :

  • CreateResponse.php
  • CreateResponseChoice.php

from laravel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.