gonzalonunez / docc-gpt Goto Github PK
View Code? Open in Web Editor NEW๐งน Self-documenting Swift code with GPT and DocC
License: MIT License
๐งน Self-documenting Swift code with GPT and DocC
License: MIT License
I ran DocC-GPT on a swift package I have called Animal Years. It is a very simple class with two methods. After running DocC-GPT on my package, it did add documentation text comments to the class and and the first method, but it clipped off the end of my first method, and completely deleted my second method.
Explore using Swift Syntax to document smaller units of code at a time instead of entire files. This would get us around some token limit issues, but I worry we may lose some of the contextual benefits of passing in entire files.
This would get us 100k context windows
Let's parallelize the script instead of documenting each file sequentially.
I just went to try this with the Swift Package Index Server repo and it throws the following error after processing what seems to be the last file in the list:
โ Finished documenting BuildIndex+Model.swift
โ Finished documenting BuildShow+View.swift
โ Finished documenting BuildShow+Model.swift
โ Finished documenting PackageResult+ModelSupport.swift
โ Finished documenting PackageShow+StructuredDataSchema.swift
โ Finished documenting PackageShow+Types.swift
โ Finished documenting routes.swift
Error: keyNotFound(CodingKeys(stringValue: "choices", intValue: nil), Swift.DecodingError.Context(codingPath: [], debugDescription: "No value associated with key CodingKeys(stringValue: \"choices\", intValue: nil) (\"choices\").", underlyingError: nil))
I believe routes.swift
is the last one, judging by the logs earlier in the list
แ
Documenting PackageShow+StructuredDataSchema.swift...
แ
Documenting PackageShow+Types.swift...
แ
Documenting routes.swift...
โ Finished documenting UpdateRecentPackages1.swift
โ Finished documenting UpdateVersionAddUrl.swift
โ Finished documenting UpdateVersionAddPublisedAtReleaseNotes.swift
โ Finished documenting CreateTarget.swift
I wonder if this is due to API metering or something? I'm using the free plan at the moment, while playing around.
Might try this in a smaller project but if you've got a pointer, that'd be great :)
If the GPT-4 32k context window still leaves us wanting with a few-shot prompt, consider fine-tuning a base model with examples of well-documented Swift code.
We can probably do something fancy Concurrency-wise together with counting tokens to get around this pretty easily
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.