Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: lookup API docs before building code #113

Open
vood opened this issue Jul 2, 2023 · 0 comments
Open

Suggestion: lookup API docs before building code #113

vood opened this issue Jul 2, 2023 · 0 comments

Comments

@vood
Copy link

vood commented Jul 2, 2023

Problem

Often, generated code encounters issues with third-party dependencies like Stripe, UI libraries, etc., leading to inaccurate output or "hallucinations".

Solution

A potential solution is to include the specific API definitions in the prompt. However, this could be optimized in the following ways:

Option 1: Use a Static List of Predefined APIs

We can create a repository subfolder containing API definitions for commonly used and popular libraries such as Stripe, MUI, NextJS, and so on. This would modify our workflow as follows:

  1. Query the prompt to identify which common libraries are being used.
  2. If available, fetch the API definitions from the static list.
  3. Incorporate these definitions into the prompt.

Option 2: Utilize a Dynamic Online List of APIs (Advanced)

Development of a simple web crawler could be done to obtain the latest API documentation from the internet. The new workflow would be:

  1. In the initial prompt, identify any mentions of third-party libraries.
  2. Proceed to search the internet for these libraries' specifications.
  3. Retrieve and condense the information found.
  4. Apply this condensed information when generating code from the prompt.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant