Model Based API Mocking
AssigneeScaled Cognition, Inc.
InventorsMathew Gardner, Adam Pauls, Jordan DeLoach
Life of this patent
Estimating the term…
Abstract
The present technology, roughly described, provides for mocking an application program interface (API) using a large language model (LLM). The present system generates a prompt with API signature information and API desired behavior information. The prompt can include instructions, library functions, examples, executed programs, and a current function invocation, as well as other content. The prompt can be generated, and submitted to an LLM to mock an API and generate a response. The response can be audited and the LLM can be fine tuned to provide improved performance in subsequent calls.
Claims20
A method for mocking an application program interface, comprising:
- generating, by a first application on a first server, an application program interface (API) signature for the API to be mocked;
- generating, by the first application, a desired behavior for the API to be mocked;
- and
- generating a prompt that includes the API signature, the API desired behavior, and world state data, the desired behavior including instructions to a machine learning model, the world state data including zero or more values related to an operation that initiated creation of the prompt, the zero or more values maintained on a second server remote from the first server;
- submitting the prompt to a large language model LLM;
- and
- receiving a response from the LLM based on the prompt, the LLM response mocking a response that would be provided by the API based on a call to the API using data contained within the prompt.
A non-transitory computer readable storage medium having embodied thereon a program, the program being executable by a processor to mocking an application program interface, the method comprising:
- generating, by a first application on a first server, an application program interface (API) signature for the API to be mocked;
- generating, by the first application, a desired behavior for the API to be mocked;
- and
- generating a prompt that includes the API signature, the API desired behavior, and world state data, the desired behavior including instructions to a machine learning model, the world state data including zero or more values related to an operation that initiated creation of the prompt, the zero or more values maintained on a second server remote from the first server;
- submitting the prompt to a large language model LLM;
- and
- receiving a response from the LLM based on the prompt, the LLM response mocking a response that would be provided by the API based on a call to the API using data contained within the prompt.
A system for automatically rendering a prompt, comprising:
- one or more servers, wherein each server includes a memory and a processor;
- and
- one or more modules stored in the memory and executed by at least one of the one or more processors to generate, by a first application on a first server, an application program interface (API) signature for the API to be mocked, generate, by the first application, a desired behavior for the API to be mocked, generate a prompt that includes the API signature, the API desired behavior, and world state data, the desired behavior including instructions to a machine learning model, the world state data including one or more values related to an operation that initiated creation of the prompt, the one or more values maintained on a second server remote from the first server, submit the prompt to a large language model LLM, and receive a response from the LLM based on the prompt, the LLM response mocking a response that would be provided by the API based on a call to the API using data contained within the prompt.
Dependencies are inferred from the claim text.