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 2b9a1bb commit eb996baCopy full SHA for eb996ba
docs/python-api.md
@@ -71,6 +71,18 @@ response = model.prompt(
71
```
72
Use `llm.Attachment(content=b"binary image content here")` to pass binary content directly.
73
74
+You can check which attachment types (if any) a model supports using the `model.attachment_types` set:
75
+
76
+```python
77
+model = llm.get_model("gpt-4o-mini")
78
+print(model.attachment_types)
79
+# {'image/gif', 'image/png', 'image/jpeg', 'image/webp'}
80
81
+if "image/jpeg" in model.attachment_types:
82
+ # Use a JPEG attachment here
83
+ ...
84
+```
85
86
### Model options
87
88
For models that support options (view those with `llm models --options`) you can pass options as keyword arguments to the `.prompt()` method:
0 commit comments