ninjalabo / llmcam

http://ninjalabo.ai/llmcam/
Apache License 2.0
0 stars 0 forks source link

OAS -> Function-Calling #10

Open doyu opened 1 week ago

doyu commented 1 week ago

Validate the automated conversion from OAS to Function Calling via OpenAI API

Task List

linhktran commented 5 days ago

An openapi.json file is automatically generated when a web is created and I have a function to extract the necessary information from OAS to be compatible with Function Calling. FC can also be made automated with further investigation.

doyu commented 5 days ago

Digitraffic provides OAS. Can we automatically convert into FC? Requested by FVH today.

linhktran commented 5 days ago

I would say it is possible because OAS has quite some necessary information to pass in a tools list.

doyu commented 5 days ago

Can you play with the above Digitraffic OAS on chatGPT and see if we could easily play with it via natural language? This should be another backlog item.

doyu commented 3 days ago

How does this OAS->FC conversion work?

Does this work as below?

  1. OAS -> Python function (Fn)
  2. Fn -> FC

Is this my understanding right? If so, for the part of the above 2, 06_class_to_fc.ipynb can be used after the above 1? 06_class_to_fc.ipynb needs some more modification to accept any functions, though.

Then, please use class_to_fc (actually, fn_to_fc, though) in 04_oas_to_fc.ipynb

Does the above make sense?

04_oas_to_fc.ipynb --renamed--> 04_oas_to_fn.ipynb

doyu commented 3 days ago

Once 04_oas_to_fc.ipynb can work with any OAS basically, please try Digitraffic OAS which FVH is interested to see how it's easy or difficult. I'll put this on our backlog item in the description.

nghivo94 commented 3 days ago

Here are some summary and information about the Open Spec file that can be useful in constructing a function, which I am using in my testing with OAS -> fastAPI

Some important attributes of this Open Spec file include:

And for each endpoint, I am extracting hese attributes:

Image

nghivo94 commented 3 days ago

Furthermore, regarding the inputs and outputs of an endpoint, here is a rough summary of different types of inputs and outputs:

Inputs

Definition in component Image

Image

Image

Outputs

doyu commented 3 days ago

Here are some summary and information about the Open Spec file that can be useful in constructing a function, which I am using in my testing with OAS -> fastAPI

Look like there should be some common component to be used "OAS->Fn" since "OAS->fastHTML" can be implemented on the top of "OAS->Fn". @nghivo94 Where can we take a look at the implementation? @linhktran Probably you can factor out some of the features from there?