Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions support #343

Open
Andromeda606 opened this issue May 19, 2024 · 0 comments
Open

Functions support #343

Andromeda606 opened this issue May 19, 2024 · 0 comments

Comments

@Andromeda606
Copy link
Contributor

Openai has function features, but types do not. Additionally, a design suitable for NestJS can be made by adding decorators.
Sample;

@OpenAiFunction('get_weather', {description: 'info'})
async function getWeather(
@Args({
     description: 'The city and state, e.g. San Francisco, CA', 
     type: 'string'
}) location,
){
  return fetch(`https://foo.bar/${location}`);
}
this.openAiService.chat({functions: ['get_weather']}); // or OpenAi.getFunction(getWeather)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant