Giter Club home page Giter Club logo

func-test-agent-llm's Introduction

API Documentation and Functional Tests Agent

This project is a collection of agents working together to write the documentation and functional tests of an API.

Here is the workflow:

  • ExtractEntrypointsAgent: read a file and extract the code of all API routes entrypoints
  • for each entrypoint:
    -- WalkCallStackAgent: retrieve all the functions involved in the API route
    -- DocumentationAgent: write API documentation according to the code of the functions
    -- WriteTestsAgent: read the documentation of an API route and list all the possible test cases
    -- for each test case:
    --- describe what would be needed to test the current case (setup, teardown, test, matchers, etc)
    --- use the test description, route documentation and feedback from Jest runner (if any) to write the code
    --- run the code
    --- (repeat until all the tests pass)

The WriteTestsAgent use a chain of 2 prompt.

  • the first prompt is used to focus the LLM on writing the expected specifications for each test case
  • the second prompt focus the LLM attention on writing and correcting the corresponding test code (it analyze error message from Jest runner to fix the code iteratively)

Example

The code present in examples/fastify/doc and examples/fastify/tests has been generated by the agents.

To try yourself, run npx ts-node run.ts and be patient

func-test-agent-llm's People

Contributors

aschen avatar oliviercavadenti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.