draftReadme
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
The Code Documentation Assistant is an AI-powered tool that helps generate documentation for code. It uses the OpenAI GPT-3.5 Turbo model to generate readme files in GitHub-flavored markdown based on the provided code.
import { draftReadme, writeReadme } from "code-doc-assistant";
async function draftReadme(options: WriterOptions): Promise<string>
The draftReadme
function generates a readme file based on the provided options.
options
(required): An object containing the following properties:username
(string): The username of the code owner.valName
(string): The name of the Val containing the code.model
(optional, default: "gpt-3.5-turbo"): The OpenAI model to use for generating the readme.userPrompt
(optional): Additional prompt to include in the documentation.
A promise that resolves to a string representing the generated readme file.
async function writeReadme(options: WriterOptions): Promise<string>
The writeReadme
function generates a readme file and updates the readme of the corresponding Val with the generated content.
options
(required): An object containing the following properties:username
(string): The username of the code owner.valName
(string): The name of the Val containing the code.model
(optional, default: "gpt-3.5-turbo"): The OpenAI model to use for generating the readme.userPrompt
(optional): Additional prompt to include in the documentation.
A promise that resolves to a string indicating the success of the readme update.
import { draftReadme, writeReadme } from "code-doc-assistant";
const options = {
username: "your-username",
valName: "your-val-name",
};
const generatedReadme = await draftReadme(options);
console.log(generatedReadme);
const successMessage = await writeReadme(options);
console.log(successMessage);
This project is licensed under the MIT License.
Migrated from folder: projects/gptTools/draftReadme