Skip to content

Commit

Permalink
docs: add section about $options argument (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
chr-hertel authored Jan 4, 2025
1 parent bec9272 commit 0930e73
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,24 @@ echo $response->getContent(); // "I'm fine, thank you. How can I help you today?

The `MessageInterface` and `Content` interface help to customize this process if needed, e.g. additional state handling.

#### Options

The second parameter of the `call` method is an array of options, which can be used to configure the behavior of the
chain, like `stream`, `output_structure`, or `response_format`. This behavior is a combination of features provided by
the underlying model and platform, or additional features provided by processors registered to the chain.

Options design for additional features provided by LLM Chain can be found in this documentation. For model and platform
specific options, please refer to the respective documentation.

```php
// Chain and MessageBag instantiation

$response = $chain->call($messages, [
'temperature' => 0.5, // example option controlling the randomness of the response, e.g. GPT and Claude
'n' => 3, // example option controlling the number of responses generated, e.g. GPT
]);
```

#### Code Examples

1. **Anthropic's Claude**: [chat-claude-anthropic.php](examples/chat-claude-anthropic.php)
Expand Down

0 comments on commit 0930e73

Please sign in to comment.