Val Town AI Readme Writer
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 to Deno.env.get("OPENAI_API_KEY")
.
Awesome!!! I'd love it if the Usage sections would output a single code snippet one could copy and paste into a val. Right now it requires a lot of different copy and pastes. Maybe a change to the prompt could fix that?
I'll do that!
Excellent! I'd simplify your API and docs like so:
I added this to the prompt:
Usage sections should include a single code snippet that a user can copy and paste.
Also, to clarify your API suggestion - you're saying move away from the class based API here?
Yep! There's no reason to do a class based thing here in my opinion
Fair! I'll refactor later this week