Skip to content

Commit

Permalink
Fixes after refactoring for 0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
ddebowczyk committed Jun 10, 2024
1 parent ea4acb5 commit 9cf4f58
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/hub/basics/complex_extraction_claude.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ $instructor = (new Instructor)->withClient($client);
echo "PROJECT EVENTS:\n\n";

$events = $instructor
->withDebug()
->onSequenceUpdate(fn($sequence) => displayEvent($sequence->last()))
->request(
messages: $report,
Expand Down
1 change: 0 additions & 1 deletion examples/01_Basics/ValidationMixin/run.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public function validate() : ValidationResult {
}

$user = (new Instructor)
->withDebug(true, false)
->respond(
messages: [['role' => 'user', 'content' => 'Jason was born in 2000 and graduated in 1023.']],
responseModel: UserDetails::class,
Expand Down
1 change: 1 addition & 0 deletions src/Clients/Anthropic/AnthropicApiRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ protected function defaultBody(): array {
'messages' => $this->messages(),
'tools' => $this->tools(),
'tool_choice' => $this->getToolChoice(),
'max_tokens' => $this->maxTokens,
],
)
);
Expand Down
2 changes: 1 addition & 1 deletion src/Clients/Cohere/Traits/HandlesRequestBody.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function tools(): array {
return $cohereFormat;
}

protected function getToolChoice(): string|array {
public function getToolChoice(): string|array {
return '';
}

Expand Down
1 change: 1 addition & 0 deletions tests/MockLLM.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ static public function get(array $args) : CanCallApi {
$mockLLM->shouldReceive('createApiRequest')->andReturnUsing(fn() => new OpenAIApiRequest());
$mockLLM->shouldReceive('getApiRequest')->andReturnUsing(fn() => new OpenAIApiRequest());
$mockLLM->shouldReceive('defaultModel')->andReturn('openai:gpt-4o');
$mockLLM->shouldReceive('defaultMaxTokens')->andReturn('256');
$mockLLM->shouldReceive('getModeRequestClass')->andReturn(OpenAIApiRequest::class);
$mockLLM->shouldReceive('get')->andReturnUsing(...$list);
$mockLLM->shouldReceive('request')->andReturn($mockLLM);
Expand Down

0 comments on commit 9cf4f58

Please sign in to comment.