Skip to content

Exploring the poitential for organizing client code around OpenAI functions

License

Notifications You must be signed in to change notification settings

johnataylor/openaifunctions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

openaifunctions

Exploring the potential for organizing client code around OpenAI functions

The function Resolver.Run will repeatedly call functions until the user's question is addressed.

The example illustrates how the model can "join" and "filter" across function results.

Naturally, if we are talking about "joins" we must be thinking in terms of sets of data. Here we are also showing how important it can be to factor your functions correctly. Specifically, providing the model with a function that deals with a single entity might just cause it to call that function multiple times as part of working towards an answer for the user. However, changing that function to be able to deal with a collection and the model will realize only a single call is needed.

It is satisfying that both arrangements work, however, the difference in cost, both performance and dollar cost, might be significant.

Note the model appears to be able to create single element collections without any trouble if it sees they are needed.

Also note the schema for collections needs to be fully specified to include the type of the elements.

A chat bot is basically another loop around this loop.

About

Exploring the poitential for organizing client code around OpenAI functions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages