We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ca5c3ca commit fcd2746Copy full SHA for fcd2746
README.md
@@ -222,17 +222,15 @@ $ export AI21_LOG_LEVEL=debug
222
```python
223
from ai21 import errors as ai21_errors
224
from ai21 import AI21Client, AI21APIError
225
+from ai21.models import ChatMessage
226
227
client = AI21Client()
228
229
system = "You're a support engineer in a SaaS company"
230
messages = [
- {
231
- "text": "Hello, I need help with a signup process.",
232
- "role": "user",
233
- "name": "Alice",
234
- },
235
-]
+ # Notice the given role does not exist and will be the reason for the raised error
+ ChatMessage(text="Hello, I need help with a signup process.", role="Non-Existent-Role"),
+ ]
236
237
try:
238
chat_completion = client.chat.create(
0 commit comments