You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+52Lines changed: 52 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -450,6 +450,58 @@ You can also capture the events for a job:
450
450
client.finetunes.list_events(id: fine_tune_id)
451
451
```
452
452
453
+
### Assistants
454
+
455
+
Assistants can call models to interact with threads and use tools to perform tasks (see [Assistant Overview](https://platform.openai.com/docs/assistants/overview).
456
+
457
+
To create a new assistant (see [API documentation](https://platform.openai.com/docs/api-reference/assistants/createAssistant)):
458
+
459
+
```
460
+
response = client.assistants.create(
461
+
parameters: {
462
+
model: "gpt-3.5-turbo-1106", # Retrieve via client.models.list. Assistants need 'gpt-3.5-turbo-1106' or later.
463
+
name: "OpenAI-Ruby test assistant",
464
+
description: nil,
465
+
instructions: "You are a helpful assistant for coding a OpenAI API client using the OpenAI-Ruby gem.",
466
+
tools: [
467
+
{ type: 'retrieval' }, # Allow access to files attached using file_ids
"file_ids": ["file-123"], # See Files section above for how to upload files
471
+
"metadata": { my_internal_version_id: '1.0.0' }
472
+
})
473
+
assistant_id = response["id"]
474
+
```
475
+
476
+
Given an `assistant_id` you can `retrieve` the current field values:
477
+
478
+
```
479
+
client.assistants.retrieve(id: assistant_id)
480
+
```
481
+
482
+
You can get a `list` of all assistants currently available under the organization:
483
+
484
+
```
485
+
client.assistants.list
486
+
```
487
+
488
+
You can modify an existing assistant using the assistant's id (see [API documentation](https://platform.openai.com/docs/api-reference/assistants/modifyAssistant)):
489
+
490
+
```
491
+
response = client.assistants.modify(
492
+
id: assistant_id,
493
+
parameters: {
494
+
name: "Modified Test Assistant for OpenAI-Ruby",
495
+
metadata: { my_internal_version_id: '1.0.1' }
496
+
})
497
+
```
498
+
499
+
You can delete assistants:
500
+
501
+
```
502
+
client.assistants.delete(id: assistant_id)
503
+
```
504
+
453
505
### Image Generation
454
506
455
507
Generate an image using DALL·E! The size of any generated images must be one of `256x256`, `512x512` or `1024x1024` -
0 commit comments