文件历史

提交图

46 次代码提交

作者 SHA1 备注 提交日期
Simon Willison b9478e6a17 batch_size= argument to embed_multi(), refs #273 2023-09-13 16:24:04 -07:00
Simon Willison f54f2c659d response.__str__ method, closes #268 2023-09-12 10:36:29 -07:00
Simon Willison 52cec1304b Binary embeddings (#254)
* Binary embeddings support, refs #253
* Write binary content to content_blob, with tests - refs #253
* supports_text and supports_binary embedding validation, refs #253
2023-09-11 18:58:44 -07:00
Simon Willison e49c816e18 Drop llm.EmbeddingModel.embedding_size property, closes #208 2023-09-02 08:45:17 -07:00
Simon Willison ec15707588 next(iter(...)), refs #200 2023-08-31 22:55:58 -07:00
Simon Willison 817aff8bae Embeddings now happen in batches, closes #200 2023-08-31 22:27:06 -07:00
Simon Willison 77cf56e54a Initial CLI support and plugin hook for embeddings, refs #185
* Embeddings plugin hook + OpenAI implementation
* llm.get_embedding_model(name) function
* llm embed command, for returning embeddings or saving them to SQLite
* Tests using an EmbedDemo embedding model
* llm embed-models list and emeb-models default commands
* llm embed-db path and llm embed-db collections commands
2023-08-27 22:24:10 -07:00
Simon Willison dff36f0edc Change of policy: keys.json over-rides environment variables, closes #158 2023-08-20 23:27:21 -07:00
Simon Willison 14a91efbad Fixes for Pydantic 1, including matrix test - refs #169
Also refs #147
2023-08-19 20:59:30 -07:00
Chris Mungall 740a8e8344 Allow for use of Pydantic v1 as well as v2. (#147)
* Allow for use of Pydantic v1 as well as v2.

Use v1-style configuration. While this is officially
deprecated (https://docs.pydantic.dev/latest/usage/model_config/),
it is supported by v2. I would assume this support will remain
for a while, this will help ease the transition to v2
2023-08-19 20:50:59 -07:00
Simon Willison cb41409e2b conversation_name should not have newlines, closes #110 2023-07-15 21:28:35 -07:00
Simon Willison 19ba1a3099 Improvements to Response.fake() plus __repr__ for some classes 2023-07-11 15:14:52 -07:00
Simon Willison abfc9c69dc Response.fake() method
I'm using this in https://github.com/simonw/llm-gpt4all/issues/4
2023-07-11 11:08:15 -07:00
Simon Willison 18a89d8bb8 Removed obsolete OptionsError class 2023-07-11 10:53:04 -07:00
Simon Willison 255f768707 Rename ._response_json to .response_json 2023-07-11 08:31:38 -07:00
Simon Willison 2d3ebe7fe1 llm logs now uses new DB schema, refs #91 2023-07-11 07:21:22 -07:00
Simon Willison 88d839fa85 Create conversations and responses tables and write to them, refs #91 2023-07-11 07:21:22 -07:00
Simon Willison 21e6d54365 Remove unused imports 2023-07-11 00:09:35 -07:00
Simon Willison 23eeb0f322 Remove experimental Model.chain() method, refs #90 2023-07-10 22:47:34 -07:00
Simon Willison b38b8314b9 Initial working implementation of conversations, refs #85 2023-07-10 22:37:45 -07:00
Simon Willison 199f7e0767 Renamed iter_prompt() to execute() and updated tutorial 2023-07-10 07:59:12 -07:00
Simon Willison ae87f978bd Moved iter_prompt from Response to Model, moved a lot of other stuff
- Moved a whole bunch of things from llm/cli.py into llm/__init__.py
- Switched plugin listings to use importlib.metadata to avoid deprecation warning
- iter_prompt() is now a method on Model, not on Response
2023-07-10 07:45:11 -07:00
Simon Willison 902cf6010c Fixed type hint on Prompt 2023-07-07 20:38:53 -07:00
Simon Willison 04568115b8 Options base class is now llm.Options not Model.Options 2023-07-05 20:47:36 -07:00
Simon Willison 4611bff412 iter_prompt() now takes prompt 2023-07-05 20:46:17 -07:00
Simon Willison b88906d459 Default __str__ method for models 2023-07-05 18:26:16 -07:00
Simon Willison 6ef6b343a9 Improved how keys work, execute() now has default implementation 2023-07-05 18:25:57 -07:00
Simon Willison 78c93b9e23 Model.execute() model now defaults to using self.Response 2023-07-05 16:57:10 -07:00
Simon Willison bc8dad1e33 stream defaults to True on prompt() method 2023-07-04 08:14:00 -07:00
Simon Willison 49e4d688c6 Removed .stream() method in favor of .prompt(stream=False) 2023-07-04 07:50:31 -07:00
Simon Willison 3136948408 Moved things into inner classes, log_message is now defined on base Response 2023-07-03 21:25:19 -07:00
Simon Willison 345ad0d2dc Implemented new logs database schema 2023-07-03 07:27:47 -07:00
Simon Willison b1c51df3f1 New LogMessage design, plus Response.json() method 2023-07-03 06:46:51 -07:00
Simon Willison 61dd8afc60 Drop the debug field from the logs, combine chunks from stream 2023-07-03 06:39:54 -07:00
Simon Willison 84b99f8baf -o/--option, implemented for OpenAI models - closes #63 2023-07-02 17:42:22 -07:00
Simon Willison 52add96ec1 Rough initial version of new logging, to log2 table 2023-07-02 16:35:36 -07:00
Simon Willison 3ed86e403d Added mypy, plus some fixes to make it happy - refs #77 2023-07-02 12:36:22 -07:00
Simon Willison 7054c673e1 Better type hint for iter_prompt method
The Generator thing is only useful if the method uses the send mechanism

Declaring it an Iterator gives people more flexibility for how they implement it.
2023-07-02 11:18:31 -07:00
Simon Willison f3f38c0c02 Initial experimental response.reply() method 2023-07-01 13:29:54 -07:00
Simon Willison 664fca165b .stream is now in base Response class 2023-07-01 13:29:27 -07:00
Simon Willison 9ac120fae4 Upgrade to pydantic 2 using bump-pydantic, refs #74 2023-07-01 11:53:54 -07:00
Simon Willison 9afc758cd7 Pass model to the Response 2023-07-01 11:29:41 -07:00
Simon Willison ffe4b6706d Model.stream() and .get_key() methods 2023-07-01 09:03:07 -07:00
Simon Willison 5e056fad8a Implemented PaLM 2, to test out new plugin hook - refs #20 2023-06-26 08:25:01 -07:00
Simon Willison 5103f77c40 New mechanism for handling API keys for models 2023-06-26 08:05:48 -07:00
Simon Willison 274126d9f8 WIP register_models() plugin hook, refs #53 2023-06-26 07:43:46 -07:00