承接 partitech/llamacloud 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

partitech/llamacloud

最新稳定版本:v0.0.3

Composer 安装命令:

composer require partitech/llamacloud

包简介

Simple php client for LamaCloud, LlamaParse and LlamaExtract services

README 文档

README

This PHP client provides a simple interface to interact with the LlamaParse API service, allowing you to perform a variety of tasks such as uploading files, retrieving job details, and obtaining results in different formats. Currently, this package only supports LlamaParse, but LlamaCloud and LlamaExtract services will be added as soon as we have time for it :).

Features

  • Upload files to the LlamaParse service
  • Retrieve job statuses and details
  • Access job results in various formats (text, raw text, JSON, Markdown, images)
  • Generate presigned URLs for downloading results
  • Monitor usage and retrieve parsing history

Installation

Install the package via composer:

composer require partitech/llamacloud

Usage

  1. Get Supported File Extensions Retrieve a list of supported file extensions.
$client = new Partitech\LlamaCloud\Client($apiKey);
$parse = new Partitech\LlamaCloud\Parse($client);
$extensions = $parse->getSupportedFileExtensions();
print_r($extensions);
$extensions = $parse->getSupportedFileExtensions();
print_r($extensions);
  1. Upload File Upload a file to LlamaParse and create a job.
$parameters = ['language' => 'en'];
$response = $parse->uploadFile('/path/to/your/file.pdf', $parameters);
print_r($response);
  1. Get Usage Data Retrieve usage data for the parsing service.
$usage = $parse->getUsage();
print_r($usage);
  1. Get Job By ID Retrieve details of a job using its ID.
$jobDetails = $parse->getJobById('job_id');
print_r($jobDetails);
  1. Get Parsing Job Details Get detailed information about a specific parsing job.
$jobDetails = $parse->getParsingJobDetails('job_id');
print_r($jobDetails);
  1. Get Job Text Result Retrieve the parsed text result of a job.
$textResult = $parse->getJobTextResult('job_id');
print_r($textResult);
  1. Get Job Raw Text Result Retrieve the raw text result of a parsing job.
$rawTextResult = $parse->getJobRawTextResult('job_id');
print_r($rawTextResult);
  1. Get Job JSON Result Retrieve the parsed JSON result of a job.
$jsonResult = $parse->getJobJsonResult('job_id');
print_r($jsonResult);
  1. Generate Presigned URL Generate a presigned URL for downloading a file associated with a job.
$presignedUrl = $parse->generatePresignedUrl('job_id', 'filename.pdf');
print_r($presignedUrl);
  1. Get Job Image Result Retrieve the image result of a parsing job.
$imageResult = $parse->getJobImageResult('job_id', 'image_name.jpg');
header('Content-Type: image/jpeg');
echo $imageResult->getContent();
  1. Get Parsing History Retrieve the parsing history.
$history = $parse->getParsingHistoryResult();
print_r($history);

Contributions

We welcome contributions to this project! Feel free to fork the repository, submit pull requests, or report any issues. Contributions to support LlamaCloud and LlamaExtract services will be highly appreciated.

License This project is licensed under the MIT License.

统计信息

  • 总下载量: 1.04k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-09-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固