Download the PHP package sharpapi/sharpapi-laravel-client without Composer

On this page you can find all versions of the php package sharpapi/sharpapi-laravel-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sharpapi-laravel-client

SharpAPI GitHub cover

SharpAPI Laravel Client - #AI Programming Interface

🚀 AI-Powered Swiss Army Knife API

Save countless hours and supercharge your app with AI capabilities in just 2 lines of code.

Latest Version on Packagist Total Downloads

Save time on repetitive content analysis and generation tasks that your app users perform daily.

See more at SharpAPI.com Website »


Requirements

If you don't use Laravel then you can find Generic SharpAPI PHP Client here »


⛲ What can it do for you?


Features

Please refer to the official:


Installation

  1. You can install the package via composer:

  2. Register at SharpApi.com and get the API key.

  3. Set the API key inside .env

That's it!


Usage

You can inject SharpApiService class or use the facade \SharpApiService singleton.

We recommend you to use Laravel queuing system to optimize dispatched jobs and the process of checking the results, especially if you process bigger batches of data.

Typical use case require these steps:

  1. Dispatch one of the available AI processing methods (this will return job processing status URL)
  2. Run fetchResults($statusUrl) method which operates in polling mode, sending underneath requests every 10 seconds for 180 seconds (these values can be customized).
  3. SharpApiJob object will be returned.
  4. For a job finished with success return status you can obtain the results with one of the methods, for example $jobResultJson = $jobResult->getResultJson().

Each dispatched job usually takes somewhere between a couple of seconds to a minute.

After that period a returned job will usually have success status and it's results will be available for further processing. Each API method returns different return format. Go to List of API methods/endpoints below for details»

Our API guarantees to return correct format every time. AI engines that SharpAPI use in rare cases have a tendency to misbehave and timeout or return incorrect data. In those cases the returned status for the job will be failed. You can rerun the exact same job request in that case.

As long as the job is still being processed by our engine it will keep returning pending status.

Controller usage example

Guzzle Exceptions

The underlying HTTP requests are facilitated by Laravel HTTP Client/Guzzle, making it advisable to familiarize yourself with common Guzzle Exceptions.


OPTIONAL custom configuration

This might come useful if you want to have more control over polling requests.

This is the contents of the published config file:

So you can overwrite these values with .env settings:


📋 List of API methods/endpoints

Each method always returns SharpApiJob object, where its getResultJson / getResultArray / getResultObject methods will return different data structure. Please refer to the detailed examples provided at SharpAPI.com

For methods that have language parameter you can also use SharpApiLanguages Enum values to make your code more readable.


🧑‍💻 HR

⭐ Parse Resume/CV File

Parses a resume (CV) file from multiple formats (PDF/DOC/DOCX/TXT/RTF) and returns an extensive object of data points.

An optional output language parameter can also be provided (English value is set as the default one) .

⭐ Generate Job Description

Based on the list of extensive parameters this endpoint provides concise job details in the response format, including the short description, job requirements, and job responsibilities. The only mandatory parameter is name.

This functionality utilizes a specialized DTO class (Data Transfer Object) parameter named JobDescriptionParameters to aid in the validation of input parameters. Only the name parameter in the constructor of this DTO is mandatory.

You can set your preferred writing style by providing a voice_tone parameter. It can be adjectives like funny or joyous, or even the name of a famous writer.

This API method also provides an optional context parameter, which can be used to supply additional flexible instructions for content processing.

⭐ Related Skills

Generates a list of related skills with their weights as a float value (1.0-10.0) where 10 equals 100%, the highest relevance score.

Only first parameter (name) is required.

You can limit the output with the max_quantity parameter.

⭐ Related Job Positions

Generates a list of related job positions with their weights as float value (1.0-10.0) where 10 equals 100%, the highest relevance score.

Only first parameter (name) is required.

You can limit the output with the max_quantity parameter.


🛒 E-commerce

⭐ Product Review Sentiment

Parses the customer's product review and provides its sentiment (POSITIVE/NEGATIVE/NEUTRAL) with a score between 0-100%. Great for sentiment report processing for any online store.

⭐ Product Categories

Generates a list of suitable categories for the product with relevance weights as a float value (1.0-10.0) where 10 equals 100%, the highest relevance score. Provide the product name and its parameters to get the best category matches possible. Comes in handy with populating product catalogue data and bulk products' processing.

You can limit the output with the max_quantity parameter.

You can set your preferred writing style by providing a voice_tone parameter. It can be adjectives like funny or joyous, or even the name of a famous writer.

Within an additional optional parameter context, you can provide a list of other categories that will be taken into consideration during the mapping process (for example your current e-commerce categories).

⭐ Generate Product Intro

Generates a shorter version of the product description. Provide as many details and parameters of the product to get the best marketing introduction possible. Comes in handy with populating product catalog data and bulk products processing.

You can limit the output with the max_length parameter. Please keep in mind that max_length serves as a strong suggestion for the Language Model, rather than a strict requirement, to maintain the general sense of the outcome.

You can set your preferred writing style by providing a voice_tone parameter. It can be adjectives like funny or joyous, or even the name of a famous writer.

⭐ Generate Thank You E-mail

Generates a personalized thank-you email to the customer after the purchase. The response content does not contain the title, greeting or sender info at the end, so you can personalize the rest of the email easily.

You can limit the output with the max_length parameter. Please keep in mind that max_length serves as a strong suggestion for the Language Model, rather than a strict requirement, to maintain the general sense of the outcome.

You can set your preferred writing style by providing a voice_tone parameter. It can be adjectives like funny or joyous, or even the name of a famous writer.

This API method also provides an optional context parameter, which can be used to supply additional flexible instructions for content processing.


📝️ Content

⭐ Translate Text

Translates provided text to selected language. 80 languages are supported. Please check included SharpApiLanguages Enum class for details.

You can set your preferred writing style by providing a voice_tone parameter. It can be adjectives like funny or joyous, or even the name of a famous writer.

An optional context parameter is also available. It can be used to provide more context to the translated text, like the use case example or some additional explanations.

⭐ Paraphrase / Rephrase

Generates a paraphrased version of the provided text. Only the content parameter is required. You can define the output language, maximum character length, and tone of voice.

Additional instructions on how to process the text can be provided in the context parameter. Please keep in mind that max_length serves as a strong suggestion for the Language Model, rather than a strict requirement, to maintain the general sense of the outcome.

You can set your preferred writing style by providing an optional voice_tone parameter. It can be adjectives like funny or joyous, or even the name of a famous writer.

This API method also provides an optional context parameter, which can be used to supply additional flexible instructions for content processing.

⭐ Proofread Text + Grammar Check

Proofreads (and checks grammar) a provided text.

⭐ Detect Spam

Checks if provided content passes a spam filtration test. Provides a percentage confidence score and an explanation for whether it is considered spam or not. This information is useful for moderators to make a final decision.

⭐ Detect Phones Numbers

Parses the provided text for any phone numbers and returns the original detected version and its E.164 format. Might come in handy in the case of processing and validating big chunks of data against phone numbers or f.e. if you want to detect phone numbers in places where they're not supposed to be.

⭐ Detect Emails

Parses the provided text for any possible emails. Might come in handy in case of processing and validating big chunks of data against email addresses or f.e. if you want to detect emails in places where they're not supposed to be.

⭐ Generate Keywords/Tags

Generates a list of unique keywords/tags based on the provided content.

You can limit the output with the max_quantity parameter.

You can set your preferred writing style by providing a voice_tone parameter.

⭐ Summarize Text

Generates a summarized version of the provided content. Perfect for generating marketing introductions of longer texts.

You can limit the output with the max_length parameter. Please keep in mind that max_length serves as a strong suggestion for the Language Model, rather than a strict requirement, to maintain the general sense of the outcome.

You can set your preferred writing style by providing a voice_tone parameter. It can be adjectives like funny or joyous, or even the name of a famous writer.


🗒 SEO

⭐ Generate SEO Tags

Generates all most important META tags based on the content provided. Make sure to include link to the website and pictures URL to get as many tags populated as possible.

You can set your preferred writing style by providing a voice_tone parameter. It can be adjectives like funny or joyous, or even the name of a famous writer.


✈️ Travel, Tourism & Hospitality

⭐ Travel Review Sentiment

Parses the Travel/Hospitality product review and provides its sentiment (POSITIVE/NEGATIVE/NEUTRAL) with a score between 0-100%. Great for sentiment report processing for any online store.

⭐ Tours & Activities Product Categories

Generates a list of suitable categories for the Tours & Activities product with relevance weights as float value (1.0-10.0) where 10 equals 100%, the highest relevance score. Provide the product name and its parameters to get the best category matches possible. Comes in handy with populating product catalogue data and bulk product processing. Only first parameter productName is required.

You can limit the output with the max_quantity parameter.

You can set your preferred writing style by providing a voice_tone parameter. It can be adjectives like funny or joyous, or even the name of a famous writer.

Within an additional optional parameter context, you can provide a list of other categories that will be taken into consideration during the mapping process (for example your current e-commerce categories).

⭐ Hospitality Product Categories

Generates a list of suitable categories for the Hospitality type product with relevance weights as float value (1.0-10.0) where 10 equals 100%, the highest relevance score. Provide the product name and its parameters to get the best category matches possible. Comes in handy with populating products catalogs data and bulk products' processing. Only first parameter productName is required.

You can limit the output with the max_quantity parameter.

You can set your preferred writing style by providing a voice_tone parameter. It can be adjectives like funny or joyous, or even the name of a famous writer.

Within an additional optional parameter context, you can provide a list of other categories that will be taken into consideration during the mapping process (for example your current e-commerce categories).


🤖 Technical API Endpoints

⭐ Subscription information / quota check

Endpoint to check details regarding the subscription's current period

will result in:

subscription_words_used_percentage is a percentage of current monthly quota usage and might serve as an alert to the user of the depleted credits. With a value above 80%, it's advised to subscribe to more credits at https://sharpapi.com/dashboard/credits to avoid service disruption.

These values are also available in the Dashboard at https://sharpapi.com/dashboard

⭐ Ping

Simple PING endpoint to check the availability of the API and it's internal timze zone (timestamp).

will result in:


Do you think our API is missing some obvious functionality?


Changelog

Please see CHANGELOG for more information on what has changed recently.


Credits


License

The MIT License (MIT). Please see License File for more information.


All versions of sharpapi-laravel-client with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
guzzlehttp/guzzle Version ^7.0
kongulov/interact-with-enum Version ^1.0
spatie/laravel-data Version ^3.0|^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sharpapi/sharpapi-laravel-client contains the following files

Loading the files please wait ....