php调用阿里通义千问VL api实现图片理解代码

代码语言:php

所属分类:其他

代码描述:php调用阿里通义千问VL api实现图片理解代码

代码标签: php 调用 阿里 通义 千问 VL api 图片 理解 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<?php

$api_key
= '你的dashscope API密钥'; // 此处替换为你的OpenAI API密钥

// 构建请求体数据
$data
= [
   
'model' => 'qwen-vl-plus',
   
'messages' => [
       
[
           
'role' => 'user',
           
'content' => [
               
[
                   
'type' => 'text',
                   
'text' => 'What’s in this image?'
               
],
               
[
                   
'type' => 'image_url'.........完整代码请登录后点击上方下载按钮下载查看

网友评论0