Is the plugin available in the API?

I’m on the waitList, looking forward to it. I’d love to use a combination of plugins to give my users a fantastic Bing-like experience.

Will the plugin be available in the API, or is it only available in Playground?

I have built something alike a day after gpt-3.5-turbo came out with PHP.

[snip]

private function getWikipediaArticleName($messages): string
{
    $lastMessage = end($messages);
    $content = $lastMessage['content'];
    $prompt = "Suggest a Wikipedia article name for the following text:\n\n".$content."\n\n";

    $response = $this->client->chat()->create([
        'model' => 'gpt-3.5-turbo',
        'messages' => [['role'=> 'user', 'content' => $prompt]],
        'max_tokens' => 3500,
    ]);

    return preg_replace("/[^a-zA-Z0-9 \$]/", "", $response->choices[0]->message->content);
}

[snip]

public function getSummary($article): string
{
    $prompt = "Get a summary of the following text (not more than 500 words - but leave dates and names) :\n\n".$article."\n\n";

    $response = $this->client->chat()->create([
        'model' => 'gpt-3.5-turbo',
        'messages' => [['role'=> 'user', 'content' => $prompt]],
        'max_tokens' => 3500,
    ]);

    return $response->choices[0]->message->content;
}

[snip]

private function getWikipediaArticleSummary($messages) {
    $wikipediaArticleName = $this->getWikipediaArticleName($messages);
    $wikipediaArticle = $this->getWikipediaArticle($wikipediaArticleName);

    return $this->getSummary($wikipediaArticle);
}

    $wikipediaArticleSummary = $this->getWikipediaArticleSummary($messages);

    $prompt = $message['role'] . PHP_EOL . PHP_EOL . "Here is some context from wikipedia:"
        . PHP_EOL . PHP_EOL .$wikipediaArticleSummary. PHP_EOL . PHP_EOL;

    $prompt = $message['role'] . PHP_EOL . PHP_EOL . $message['content'];

    $messages[$i] = [
        'role' => $message['role'],
        'content' => $prompt
    ];

Since plugins don’t give any more tokens I don’t really see the point in using them.

Just take your data and send it with the prompt (or better send it with a system instead of user prompt).

You may as well send CVs and job openings and let the model decide the fit for the role based on the CV.

1 Like