Skip to content

Commit badefed

Browse files
committed
re-index, release v0.0.8
1 parent 338247c commit badefed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1124
-1174
lines changed

.autodoc/docs/data/docstore.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

.autodoc/docs/data/hnswlib.index

-6.14 KB
Binary file not shown.

.autodoc/docs/json/package.json

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"fileName": "index.ts",
33
"filePath": "src/cli/commands/estimate/index.ts",
4-
"url": "https://github.com/context-labs/autodoc/blob/master/src/cli/commands/estimate/index.ts",
5-
"summary": "The `estimate` function in this file is a part of the larger autodoc project and is responsible for estimating the cost of indexing a given repository. The function takes in an object with several properties including the name of the repository, its URL, the root directory, the output directory, and some other optional parameters. \n\nThe function first sets the path for the output directory where the JSON files will be stored. It then runs a dry run of the `processRepository` command to estimate the cost of indexing the repository. The `processRepository` function is imported from the `processRepository.js` file located in the `index` directory. It takes in an object with the same properties as the `estimate` function and a boolean value indicating whether it should be a dry run or not. The function returns an object with details about the models that will be created during the indexing process.\n\nOnce the `processRepository` function has completed, the `estimate` function prints the details of the models that will be created and the estimated cost of indexing the repository. The `printModelDetails` function is imported from the `LLMUtil.js` file located in the `utils` directory and takes in an array of objects representing the models. The `totalIndexCostEstimate` function is also imported from the same file and takes in the same array of objects. It calculates the total cost of indexing the repository based on the estimated cost of each model.\n\nFinally, the function logs the estimated cost to the console using the `chalk` library to color the output. It reminds the user that the estimate is just an estimate and that the actual cost may vary. It also recommends setting a limit in the OpenAI account to prevent unexpected charges.\n\nOverall, the `estimate` function provides a convenient way for users of the autodoc project to estimate the cost of indexing a repository before actually doing so. This can help users make informed decisions about whether or not to proceed with the indexing process. \n\nExample usage:\n\n```\nimport { estimate } from 'autodoc';\n\nestimate({\n name: 'my-repo',\n repositoryUrl: 'https://github.com/my-username/my-repo.git',\n root: '/path/to/repo',\n output: '/path/to/output',\n llms: true,\n ignore: ['node_modules', 'dist'],\n});\n```",
6-
"questions": "1. What is the purpose of this code?\n - This code is used to estimate the cost of indexing a repository for the Autodoc project.\n2. What dependencies does this code use?\n - This code uses several dependencies including `path`, `chalk`, and custom modules from the `../../spinner.js`, `../index/processRepository.js`, and `../../utils/LLMUtil.js` files.\n3. What input parameters does the `estimate` function expect?\n - The `estimate` function expects an object with properties `name`, `repositoryUrl`, `root`, `output`, `llms`, and `ignore`, all of which are of type `AutodocRepoConfig`."
4+
"url": "https://github.com/context-labs/autodoc/src/cli/commands/estimate/index.ts",
5+
"summary": "The `estimate` function in this code file is responsible for providing an estimated cost of indexing a given repository using the AutodocRepoConfig configuration. This function is particularly useful for users who want to get an idea of the cost involved in processing their repository before actually running the process.\n\nThe function takes an `AutodocRepoConfig` object as input, which contains various configuration options such as the repository name, URL, root directory, output directory, and other settings related to the processing of the repository.\n\nThe main steps involved in the function are:\n\n1. Set the output path for the JSON files generated during the process.\n2. Update the spinner text to display \"Estimating cost...\".\n3. Perform a dry run of the `processRepository` function with the given configuration options. The dry run does not actually process the repository but instead returns the details of the models that would be processed.\n4. Stop the spinner once the dry run is complete.\n5. Print the details of the models obtained from the dry run using the `printModelDetails` utility function.\n6. Calculate the total estimated cost using the `totalIndexCostEstimate` utility function.\n7. Display the estimated cost in a user-friendly format using the `chalk` library.\n\nHere's an example of how the `estimate` function might be used in the larger project:\n\n```javascript\nimport { estimate } from './autodoc/estimate';\n\nconst config = {\n name: 'my-repo',\n repositoryUrl: 'https://github.com/user/my-repo.git',\n root: './',\n output: './output/',\n llms: ['en'],\n ignore: ['.git', 'node_modules'],\n filePrompt: true,\n folderPrompt: true,\n chatPrompt: true,\n contentType: 'code',\n targetAudience: 'developers',\n linkHosted: true,\n};\n\nestimate(config);\n```\n\nThis example demonstrates how a user can call the `estimate` function with a specific configuration to get an estimated cost for processing their repository.",
6+
"questions": "1. **What is the purpose of the `estimate` function and what parameters does it accept?**\n\n The `estimate` function is used to estimate the cost of processing a repository for indexing. It accepts an `AutodocRepoConfig` object as a parameter, which contains various configuration options such as repository URL, output path, and other settings.\n\n2. **How does the `estimate` function calculate the cost estimate?**\n\n The `estimate` function performs a dry run of the `processRepository` command to get the estimated price for indexing the repository. It then uses the `totalIndexCostEstimate` function to calculate the total cost based on the returned run details.\n\n3. **What is the purpose of the `printModelDetails` function and how is it used in the `estimate` function?**\n\n The `printModelDetails` function is used to display the details of the models used in the estimation process. In the `estimate` function, it is called with the values of the `runDetails` object to print the model details before displaying the total cost estimate."
77
}

0 commit comments

Comments
 (0)