llm/docs
Simon Willison ba75c674cb
llm.get_async_model(), llm.AsyncModel base class and OpenAI async models (#613)
- https://github.com/simonw/llm/issues/507#issuecomment-2458639308

* register_model is now async aware

Refs https://github.com/simonw/llm/issues/507#issuecomment-2458658134

* Refactor Chat and AsyncChat to use _Shared base class

Refs https://github.com/simonw/llm/issues/507#issuecomment-2458692338

* fixed function name

* Fix for infinite loop

* Applied Black

* Ran cog

* Applied Black

* Add Response.from_row() classmethod back again

It does not matter that this is a blocking call, since it is a classmethod

* Made mypy happy with llm/models.py

* mypy fixes for openai_models.py

I am unhappy with this, had to duplicate some code.

* First test for AsyncModel

* Still have not quite got this working

* Fix for not loading plugins during tests, refs #626

* audio/wav not audio/wave, refs #603

* Black and mypy and ruff all happy

* Refactor to avoid generics

* Removed obsolete response() method

* Support text = await async_mock_model.prompt("hello")

* Initial docs for llm.get_async_model() and await model.prompt()

Refs #507

* Initial async model plugin creation docs

* duration_ms ANY to pass test

* llm models --async option

Refs https://github.com/simonw/llm/pull/613#issuecomment-2474724406

* Removed obsolete TypeVars

* Expanded register_models() docs for async

* await model.prompt() now returns AsyncResponse

Refs https://github.com/simonw/llm/pull/613#issuecomment-2475157822

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-11-13 17:51:00 -08:00
..
_templates Custom title for docs homepage, closes #105 2023-07-12 12:20:16 -07:00
embeddings Use 3-small in docs instead of ada-002 2024-07-18 12:23:49 -07:00
plugins llm.get_async_model(), llm.AsyncModel base class and OpenAI async models (#613) 2024-11-13 17:51:00 -08:00
.gitignore Multi-page docs using Markdown and Sphinx, refs #21 2023-06-15 17:51:12 +01:00
aliases.md Show attachment types in llm models --options, closes #612 2024-11-05 22:49:26 -08:00
changelog.md Release 0.17 2024-10-28 19:36:12 -07:00
conf.py Fix a warning about _static in docs builds 2023-07-10 21:45:07 -07:00
contributing.md Syntax highlighting for docs/contributing.md 2024-01-26 12:05:58 -08:00
help.md llm.get_async_model(), llm.AsyncModel base class and OpenAI async models (#613) 2024-11-13 17:51:00 -08:00
index.md Docs for CLI attachments, refs #587 2024-10-28 15:41:34 -07:00
logging.md Run cog -r in PRs, use that to update logging.md with new tables (#616) 2024-11-06 06:56:19 -08:00
Makefile Multi-page docs using Markdown and Sphinx, refs #21 2023-06-15 17:51:12 +01:00
openai-models.md Show attachment types in llm models --options, closes #612 2024-11-05 22:49:26 -08:00
other-models.md Allow passing of can_stream in openai_models.py (#600) 2024-11-05 23:04:13 -08:00
python-api.md llm.get_async_model(), llm.AsyncModel base class and OpenAI async models (#613) 2024-11-13 17:51:00 -08:00
related-tools.md Reference IDs 2023-09-05 14:22:33 -07:00
requirements.txt Bump the python-packages group with 1 update (#279) 2023-10-24 14:07:18 -07:00
setup.md Release 0.15 2024-07-18 12:31:14 -07:00
templates.md llm models and llm templates default to list, closes #167 2023-08-19 20:04:14 -07:00
usage.md audio/wav not audio/wave, refs #603 2024-11-12 21:43:07 -08:00