Skip to content

Commit

Permalink
Pushing minor fix to ai module replace data with config
Browse files Browse the repository at this point in the history
  • Loading branch information
anant-writer committed Jun 5, 2024
1 parent e9bcc3c commit ae3be30
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/framework/ai-module.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -98,25 +98,25 @@ for chunk in conversation.stream_complete():
```
</CodeGroup>

Instance-wide configuration parameters can be complemented or overriden on individual call's level, if a `data` dictionary is provided to the method:
Instance-wide configuration parameters can be complemented or overriden on individual call's level, if a `config` dictionary is provided to the method:

```python
# Overriding configuration for a specific call
response = conversation.complete(data={'max_tokens': 200, 'temperature': 0.5})
response = conversation.complete(config={'max_tokens': 200, 'temperature': 0.5})
```

## Text completions without a conversation state
These `complete` and `stream_complete` methods are designed for one-off text completions without the need to manage a conversation state. They return the model's response as a string. Each function accepts a `data` dictionary allowing call-specific configurations.
These `complete` and `stream_complete` methods are designed for one-off text completions without the need to manage a conversation state. They return the model's response as a string. Each function accepts a `config` dictionary allowing call-specific configurations.

<CodeGroup>
```python complete
# Using `complete` for a single completion
text_response = complete("Explore the benefits of AI.", data={'temperature': 0.3})
text_response = complete("Explore the benefits of AI.", config={'temperature': 0.3})
print("Completion:", text_response)
```
```python stream_complete
# Using `stream_complete` for streamed text completions
for text_chunk in stream_complete("Explore the benefits of AI.", data={'temperature': 0.3}):
for text_chunk in stream_complete("Explore the benefits of AI.", config={'temperature': 0.3}):
print("Streamed Text:", text_chunk)
```
</CodeGroup>
Expand Down

0 comments on commit ae3be30

Please sign in to comment.