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

OpenAI functions #3

Open
henneberger opened this issue Oct 21, 2024 · 0 comments
Open

OpenAI functions #3

henneberger opened this issue Oct 21, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@henneberger
Copy link

henneberger commented Oct 21, 2024

For vector embedding and GPT completion on text strings using OpenAI’s models.
This should call the API directly and not use libraries. Use environmental variable OPENAI_API_KEY.

  • vector_embed(text String, model_name String): Use the OpenAI API for vector embedding for the given model name. Automatically truncate text if it is too long. Returns vector type.
  • extract_json(prompt String, model_name String, temperature* DOUBLE, top_p* DOUBLE): Use the completion API with json return type. Returns json type.
  • completion(prompt String, model_name String, max_output_tokens* INT, temperature* DOUBLE, top_p* DOUBLE): Uses the completion API to generate a String.

Should have 'counter' metrics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Ready
Development

No branches or pull requests

2 participants