2
$\begingroup$

We are currently developing an application that performs actions based on user input using 'gpt-3.5-turbo-0613'.

For example, if a user enters the prompt "create a user with the name Potter and the role wizard," it should call the add_admin method available in our SDK.

To enhance the capabilities of the application, we would like to train the underlying GPT model using our Swagger document(of the API which the SDK internally calls). The Swagger document contains valuable information about the API endpoints and request/response structures. However, we are facing difficulties in adapting the current GPT model to incorporate this specific training data.

$\endgroup$
4
  • $\begingroup$ What "difficulties"? $\endgroup$
    – noe
    Commented Jun 20, 2023 at 11:59
  • $\begingroup$ Also, how are you planning to train gpt-3.5-turbo if it's not among the models that support fine-tuning in the OpenAI services? $\endgroup$
    – noe
    Commented Jun 20, 2023 at 21:10
  • $\begingroup$ Could you suggest an open-source alternative that will serve the use case? $\endgroup$ Commented Jun 21, 2023 at 8:30
  • $\begingroup$ I included the requested information as an answer. If you find it useful, please consider upvoting it. Also, please consider accepting it (with the tick mark ✓ next to it) if you consider it correct or, alternatively, please describe in a comment why you consider it incorrect or not clear enough. $\endgroup$
    – noe
    Commented Jun 21, 2023 at 15:34

2 Answers 2

1
$\begingroup$

You cannot train gpt-3.5-turbo because it's not among the models that support fine-tuning in the OpenAI services

Open-source alternatives are, in general, vastly inferior to ChatGPT, but there may be cases where they are enough. You may check the LangChain library, which makes it easier to integrate external functionality they way you described. You can use it with many different models. You could try with some of the powerful ones like falcon-40b to see if they are enough, and then try something smaller if you have hardware constraints.

$\endgroup$
1
  • $\begingroup$ Our objective is to utilise a Swagger documentation that encompasses all available endpoints and their corresponding parameters. By prompting the model with specific instructions like "Create a user" or "Create a device," the model will extract the necessary details from the Swagger documentation. Additionally, the model will inquire about any supplementary information needed to execute these tasks effectively. We seek guidance on accomplishing this objective, with the goal of enabling the model to autonomously determine which API endpoint to call and the appropriate parameters to include. $\endgroup$ Commented Jun 21, 2023 at 18:10
0
$\begingroup$

I suggest you take a look at RestGPT: Connecting Large Language Models with Real-World RESTful APIs

Note that with this approach the limiting factor in passing the OpenAPI spec files becomes the context window, so I suggest leveraging models that allow for larger context windows, such as Claude 2 (100k tokens).

It is essentially a combination of chain of thought and Langchain APIChain Here is an example from their paper: tmdb example

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.