readmeGPT
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.
This val provides a class ReadmeWriter for generating readmes for vals with OpenAI. It can both draft readmes and update them directly
PRs welcome! See Todos below for some ideas I have.
To draft a readme for a given code, use the draftReadme method:
import { ReadmeWriter } from "https://esm.town/v/nbbaier/readmeGPT";
const readmeWriter = new ReadmeWriter({});
const val = "https://www.val.town/v/:username/:valname";
const generatedReadme = await readmeWriter.draftReadme(val);
To write and update a readme for a given code, use the writeReadme method:
import { ReadmeWriter } from "https://esm.town/v/nbbaier/readmeGPT";
const readmeWriter = new ReadmeWriter({});
const val = "https://www.val.town/v/:username/:valname";
const successMessage = await readmeWriter.writeReadme(val);
The ReadmeWriter class represents a utility for generating and updating README files.
Creates an instance of the ReadmeWriter class.
model(optional): The model to be used for generating the readme. Defaults to "gpt-3.5-turbo".apiKey(optional): An OpenAI API key. Defaults toDeno.env.get("OPENAI_API_KEY").
-
draftReadme(val: string): Promise<string>: Generates a readme for the given val.-
Parameters:
val: URL of the code repository.
-
Returns:
- A promise that resolves to the generated readme.
-
-
writeReadme(val: string): Promise<string>: Generates and updates a readme for the given val.-
Parameters:
val: URL of the code repository.
-
Returns:
- A promise that resolves to a success message if the update is successful.
-
- Additional options to pass to the OpenAI model
- Ability to pass more instructions to the prompt to modify how the readme is constructed
Migrated from folder: projects/gptTools/readmeGPT