llmware icon indicating copy to clipboard operation
llmware copied to clipboard

Add docstrings

Open mjspeck opened this issue 1 year ago • 9 comments

Obviously this would be pretty big for a single issue but that fact that most methods don't seem to have docstrings is troubling. The tutorials you have are very helpful but they're not a full replacement for actual docstrings, type annotations, etc. which make it much easier to build using llmware. Happy to contribute as well, but that would require knowing what docstring format y'all prefer and other style guide standards.

mjspeck avatar Dec 22 '23 21:12 mjspeck

I can also contribute

rahpandey1 avatar Dec 25 '23 03:12 rahpandey1

@mjspeck and @rahpandey1 - appreciate this feedback. We have taken initial steps on docstrings - very simple and lightweight through the main code. Realize that there is a lot more to do here - would welcome ideas and help to improve on this starting point. On type annotations for Python, we have debated it internally quite a bit - and right now, would probably side with prioritizing docstrings as well as core documentation.

doberst avatar Jan 21 '24 10:01 doberst

I'm also happy to contribute on this!

MacOS avatar Jan 23 '24 21:01 MacOS

I would suggest to add docstrings systematically in the following order, where one point is one issues and hence one pull request.

  1. Add docstrings to all modules,
  2. Add docstrings to all classes and functions,
  3. Add docstrings to all methods and class methods.

MacOS avatar Feb 08 '24 13:02 MacOS

I submitted the pull request #406 that adds docstrings to all modules, and the package.

After this PR has been merged, we can move forward by adding docstrings to the classes.

MacOS avatar Feb 14 '24 10:02 MacOS

I submitted the pull request #449 to add class docstrings to four modules. I decided to split up adding class docstrings, since one pull request that adds class docstrings to all classes would be too large.

MacOS avatar Feb 26 '24 16:02 MacOS

To better organise the documentation effort, here is a list of what needs to be done, including what has already been done and what still needs to be done.

  • [x] Package docstring (PR #406)
  • [x] Module docstrings (PR #406)
    • [x] agents (PR #406)
    • [x] configs (PR #406)
    • [x] embeddings (PR #406)
    • [x] exceptions (PR #406)
    • [x] library (PR #406)
    • [x] model_configs (PR #406)
    • [x] models (PR #406)
    • [x] parsers (PR #406)
    • [x] prompts (PR #406)
    • [x] resources (PR #406)
    • [x] retrieval (PR #406)
    • [x] setup (PR #406)
    • [x] status (PR #406)
    • [x] util (PR #406)
  • [ ] Class docstrings (PR #449, )
    • [x] module agents (PR #449)
    • [x] module embeddings (PR #449)
    • [x] module library (PR #449)
    • [x] module status (PR #449)
    • [ ] module configs
    • [ ] module exceptions
    • [ ] module model_configs
    • [ ] module models
    • [ ] module parsers
    • [x] module prompts (PR #495)
    • [ ] module resources
    • [x] module retrieval (PR #478)
    • [x] module setup (PR #473)
    • [ ] module util
  • [ ] Method docstrings
    • [ ] module library
      • [ ] class Library
      • [ ] class LibraryCatalog

MacOS avatar Feb 26 '24 18:02 MacOS

Sorry I haven't been active on this. I'll take a look in the next week at what I can contribute.

mjspeck avatar Feb 26 '24 20:02 mjspeck

@mjspeck No worries. Please post first on what you are working before you start. I would recommend that you pick on module and add class docstrings to all classes there, and then submit this as a PR. Otherwise, the PR gets too big.

MacOS avatar Feb 28 '24 18:02 MacOS

Docstrings substantially complete throughout the code base. If specific request, we can open up as a new issue.

doberst avatar May 05 '24 17:05 doberst