Skip to content

Commit

Permalink
Merge pull request #505 from gauztech/patch-2
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
nunomaduro authored Dec 22, 2024
2 parents 4a565d1 + 1745dfb commit 17d1a23
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,11 @@ $response->object; // 'text_completion'
$response->created; // 1589478378
$response->model; // 'gpt-3.5-turbo-instruct'

foreach ($response->choices as $result) {
$result->text; // '\n\nThis is a test'
$result->index; // 0
$result->logprobs; // null
$result->finishReason; // 'length' or null
foreach ($response->choices as $choice) {
$choice->text; // '\n\nThis is a test'
$choice->index; // 0
$choice->logprobs; // null
$choice->finishReason; // 'length' or null
}

$response->usage->promptTokens; // 5,
Expand Down Expand Up @@ -217,11 +217,11 @@ $response->object; // 'chat.completion'
$response->created; // 1677701073
$response->model; // 'gpt-3.5-turbo-0301'

foreach ($response->choices as $result) {
$result->index; // 0
$result->message->role; // 'assistant'
$result->message->content; // '\n\nHello there! How can I assist you today?'
$result->finishReason; // 'stop'
foreach ($response->choices as $choice) {
$choice->index; // 0
$choice->message->role; // 'assistant'
$choice->message->content; // '\n\nHello there! How can I assist you today?'
$choice->finishReason; // 'stop'
}

$response->usage->promptTokens; // 9,
Expand Down Expand Up @@ -269,15 +269,15 @@ $response->object; // 'chat.completion'
$response->created; // 1677701073
$response->model; // 'gpt-3.5-turbo-0613'

foreach ($response->choices as $result) {
$result->index; // 0
$result->message->role; // 'assistant'
$result->message->content; // null
$result->message->toolCalls[0]->id; // 'call_123'
$result->message->toolCalls[0]->type; // 'function'
$result->message->toolCalls[0]->function->name; // 'get_current_weather'
$result->message->toolCalls[0]->function->arguments; // "{\n \"location\": \"Boston, MA\"\n}"
$result->finishReason; // 'tool_calls'
foreach ($response->choices as $choice) {
$choice->index; // 0
$choice->message->role; // 'assistant'
$choice->message->content; // null
$choice->message->toolCalls[0]->id; // 'call_123'
$choice->message->toolCalls[0]->type; // 'function'
$choice->message->toolCalls[0]->function->name; // 'get_current_weather'
$choice->message->toolCalls[0]->function->arguments; // "{\n \"location\": \"Boston, MA\"\n}"
$choice->finishReason; // 'tool_calls'
}

$response->usage->promptTokens; // 82,
Expand Down Expand Up @@ -320,13 +320,13 @@ $response->object; // 'chat.completion'
$response->created; // 1677701073
$response->model; // 'gpt-3.5-turbo-0613'

foreach ($response->choices as $result) {
$result->index; // 0
$result->message->role; // 'assistant'
$result->message->content; // null
$result->message->functionCall->name; // 'get_current_weather'
$result->message->functionCall->arguments; // "{\n \"location\": \"Boston, MA\"\n}"
$result->finishReason; // 'function_call'
foreach ($response->choices as $choice) {
$choice->index; // 0
$choice->message->role; // 'assistant'
$choice->message->content; // null
$choice->message->functionCall->name; // 'get_current_weather'
$choice->message->functionCall->arguments; // "{\n \"location\": \"Boston, MA\"\n}"
$choice->finishReason; // 'function_call'
}

$response->usage->promptTokens; // 82,
Expand Down Expand Up @@ -2197,9 +2197,9 @@ $response = $client->edits()->create([
$response->object; // 'edit'
$response->created; // 1589478378

foreach ($response->choices as $result) {
$result->text; // 'What day of the week is it?'
$result->index; // 0
foreach ($response->choices as $choice) {
$choice->text; // 'What day of the week is it?'
$choice->index; // 0
}

$response->usage->promptTokens; // 25,
Expand Down

0 comments on commit 17d1a23

Please sign in to comment.