Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prompt should be optional so model.prompt(attachments=llm.Attachment(...)) works #784

Closed
simonw opened this issue Feb 27, 2025 · 2 comments
Labels
enhancement New feature or request python-api

Comments

@simonw
Copy link
Owner

simonw commented Feb 27, 2025

It's optional in the CLI but not in the Python API.

@simonw simonw added enhancement New feature or request python-api labels Feb 27, 2025
@simonw
Copy link
Owner Author

simonw commented Feb 27, 2025

>>> import llm
>>> model = llm.get_model("gpt-4o-mini")
>>> model.prompt(attachments=[llm.Attachment(url="https://static.simonwillison.net/static/2024/pelican.jpg")])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: _Model.prompt() missing 1 required positional argument: 'prompt'

@simonw
Copy link
Owner Author

simonw commented Feb 27, 2025

After the fix:

>>> print(model.prompt(attachments=[llm.Attachment(url="https://static.simonwillison.net/static/2024/pelican.jpg")]))
This image features a pelican standing on rocks near the water. Pelicans are large water birds known for their distinctive long bills and throat pouches, which they use for fishing. The setting includes some boats in the background, suggesting a coastal environment. If you have any specific questions about pelicans or the scene, feel free to ask!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python-api
Projects
None yet
Development

No branches or pull requests

1 participant