helpers icon indicating copy to clipboard operation
helpers copied to clipboard

HelpersTask207_create_index_for_readme

Open tkpratardan opened this issue 11 months ago • 3 comments

#207

tkpratardan avatar Jan 15 '25 12:01 tkpratardan

@gpsaggese According to my understand README.md is the index file. and the goal https://github.com/causify-ai/helpers/issues/207 is to generate the index file. The approach is based on this assumption and create and execute which:

  • searches for the README.md in the root of the repo, and creates one if it is not present.
  • Creates an index in based on the directory where the readme is located. This is done by traversing the repo and listing the markdown files in each dir.
  • Generates 2 line summaries based for each md file if needed (controlled through set of args)

This is not a polished code, WDYT of the approach?

tkpratardan avatar Jan 15 '25 14:01 tkpratardan

Cool stuff! See some comments below. But most importantly, have you tried it out? Does it work?:) Would be best, of course, if we could have some tests for the key functions.

We could create a set of tests by mocking the openai client. But the actual working depends a lot on the kind of the subscription we have to the OpenAI API (for now since it is personal api keys). For smaller docs it might not be a problem, but for bigger docs, we will hit the token limit.

tkpratardan avatar Jan 22 '25 13:01 tkpratardan

Cool stuff! See some comments below. But most importantly, have you tried it out? Does it work?:) Would be best, of course, if we could have some tests for the key functions.

We could create a set of tests by mocking the openai client. But the actual working depends a lot on the kind of the subscription we have to the OpenAI API (for now since it is personal api keys). For smaller docs it might not be a problem, but for bigger docs, we will hit the token limit.

I agree, this can be a problem. Can we add a parameter to bypass summary generation and just add something in its place (e.g. "Insert summary for <file_name> here" or "Placeholder summary for <file_name>")? And then we can run the tests with that parameter enabled.

sonniki avatar Jan 22 '25 13:01 sonniki

import openai raised an error 'No Module Found', which means that the docker container do not have openai installed. I also do not have the authority to install inside docker. So a temp fix is to encapsulate import hopenai in the function where it is called generate_summary_for_file().

Logic changes are in https://github.com/causify-ai/helpers/issues/207#issuecomment-2795737604.

aangelo9 avatar Apr 11 '25 03:04 aangelo9