New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

openapi_openai

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openapi_openai

  • 1.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

openapi_openai

OpenApiOpenAIClient - the Ruby gem for the OpenAI API

The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details.

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 2.0.0
  • Package version: 1.1.0
  • Generator version: 7.4.0
  • Build package: org.openapitools.codegen.languages.RubyClientCodegen For more information, please visit https://github.com/oapicf/openapi-openai

Installation

Build a gem

To build the Ruby code into a gem:

gem build openapi_openai.gemspec

Then either install the gem locally:

gem install ./openapi_openai-1.1.0.gem

(for development, run gem install --dev ./openapi_openai-1.1.0.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'openapi_openai', '~> 1.1.0'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:

gem 'openapi_openai', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'openapi_openai'

# Setup authorization
OpenApiOpenAIClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
  # Configure a proc to get access tokens in lieu of the static access_token configuration
  config.access_token_getter = -> { 'YOUR TOKEN GETTER PROC' } 
end

api_instance = OpenApiOpenAIClient::AssistantsApi.new
thread_id = 'thread_id_example' # String | The ID of the thread to which this run belongs.
run_id = 'run_id_example' # String | The ID of the run to cancel.

begin
  #Cancels a run that is `in_progress`.
  result = api_instance.cancel_run(thread_id, run_id)
  p result
rescue OpenApiOpenAIClient::ApiError => e
  puts "Exception when calling AssistantsApi->cancel_run: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://api.openai.com/v1

ClassMethodHTTP requestDescription
OpenApiOpenAIClient::AssistantsApicancel_runPOST /threads/{thread_id}/runs/{run_id}/cancelCancels a run that is in_progress.
OpenApiOpenAIClient::AssistantsApicreate_assistantPOST /assistantsCreate an assistant with a model and instructions.
OpenApiOpenAIClient::AssistantsApicreate_assistant_filePOST /assistants/{assistant_id}/filesCreate an assistant file by attaching a File to an assistant.
OpenApiOpenAIClient::AssistantsApicreate_messagePOST /threads/{thread_id}/messagesCreate a message.
OpenApiOpenAIClient::AssistantsApicreate_runPOST /threads/{thread_id}/runsCreate a run.
OpenApiOpenAIClient::AssistantsApicreate_threadPOST /threadsCreate a thread.
OpenApiOpenAIClient::AssistantsApicreate_thread_and_runPOST /threads/runsCreate a thread and run it in one request.
OpenApiOpenAIClient::AssistantsApidelete_assistantDELETE /assistants/{assistant_id}Delete an assistant.
OpenApiOpenAIClient::AssistantsApidelete_assistant_fileDELETE /assistants/{assistant_id}/files/{file_id}Delete an assistant file.
OpenApiOpenAIClient::AssistantsApidelete_threadDELETE /threads/{thread_id}Delete a thread.
OpenApiOpenAIClient::AssistantsApiget_assistantGET /assistants/{assistant_id}Retrieves an assistant.
OpenApiOpenAIClient::AssistantsApiget_assistant_fileGET /assistants/{assistant_id}/files/{file_id}Retrieves an AssistantFile.
OpenApiOpenAIClient::AssistantsApiget_messageGET /threads/{thread_id}/messages/{message_id}Retrieve a message.
OpenApiOpenAIClient::AssistantsApiget_message_fileGET /threads/{thread_id}/messages/{message_id}/files/{file_id}Retrieves a message file.
OpenApiOpenAIClient::AssistantsApiget_runGET /threads/{thread_id}/runs/{run_id}Retrieves a run.
OpenApiOpenAIClient::AssistantsApiget_run_stepGET /threads/{thread_id}/runs/{run_id}/steps/{step_id}Retrieves a run step.
OpenApiOpenAIClient::AssistantsApiget_threadGET /threads/{thread_id}Retrieves a thread.
OpenApiOpenAIClient::AssistantsApilist_assistant_filesGET /assistants/{assistant_id}/filesReturns a list of assistant files.
OpenApiOpenAIClient::AssistantsApilist_assistantsGET /assistantsReturns a list of assistants.
OpenApiOpenAIClient::AssistantsApilist_message_filesGET /threads/{thread_id}/messages/{message_id}/filesReturns a list of message files.
OpenApiOpenAIClient::AssistantsApilist_messagesGET /threads/{thread_id}/messagesReturns a list of messages for a given thread.
OpenApiOpenAIClient::AssistantsApilist_run_stepsGET /threads/{thread_id}/runs/{run_id}/stepsReturns a list of run steps belonging to a run.
OpenApiOpenAIClient::AssistantsApilist_runsGET /threads/{thread_id}/runsReturns a list of runs belonging to a thread.
OpenApiOpenAIClient::AssistantsApimodify_assistantPOST /assistants/{assistant_id}Modifies an assistant.
OpenApiOpenAIClient::AssistantsApimodify_messagePOST /threads/{thread_id}/messages/{message_id}Modifies a message.
OpenApiOpenAIClient::AssistantsApimodify_runPOST /threads/{thread_id}/runs/{run_id}Modifies a run.
OpenApiOpenAIClient::AssistantsApimodify_threadPOST /threads/{thread_id}Modifies a thread.
OpenApiOpenAIClient::AssistantsApisubmit_tool_ouputs_to_runPOST /threads/{thread_id}/runs/{run_id}/submit_tool_outputsWhen a run has the status: \"requires_action\" and required_action.type is submit_tool_outputs, this endpoint can be used to submit the outputs from the tool calls once they're all completed. All outputs must be submitted in a single request.
OpenApiOpenAIClient::AudioApicreate_speechPOST /audio/speechGenerates audio from the input text.
OpenApiOpenAIClient::AudioApicreate_transcriptionPOST /audio/transcriptionsTranscribes audio into the input language.
OpenApiOpenAIClient::AudioApicreate_translationPOST /audio/translationsTranslates audio into English.
OpenApiOpenAIClient::ChatApicreate_chat_completionPOST /chat/completionsCreates a model response for the given chat conversation.
OpenApiOpenAIClient::CompletionsApicreate_completionPOST /completionsCreates a completion for the provided prompt and parameters.
OpenApiOpenAIClient::EmbeddingsApicreate_embeddingPOST /embeddingsCreates an embedding vector representing the input text.
OpenApiOpenAIClient::FilesApicreate_filePOST /filesUpload a file that can be used across various endpoints. The size of all the files uploaded by one organization can be up to 100 GB. The size of individual files can be a maximum of 512 MB or 2 million tokens for Assistants. See the Assistants Tools guide to learn more about the types of files supported. The Fine-tuning API only supports .jsonl files. Please contact us if you need to increase these storage limits.
OpenApiOpenAIClient::FilesApidelete_fileDELETE /files/{file_id}Delete a file.
OpenApiOpenAIClient::FilesApidownload_fileGET /files/{file_id}/contentReturns the contents of the specified file.
OpenApiOpenAIClient::FilesApilist_filesGET /filesReturns a list of files that belong to the user's organization.
OpenApiOpenAIClient::FilesApiretrieve_fileGET /files/{file_id}Returns information about a specific file.
OpenApiOpenAIClient::FineTuningApicancel_fine_tuning_jobPOST /fine_tuning/jobs/{fine_tuning_job_id}/cancelImmediately cancel a fine-tune job.
OpenApiOpenAIClient::FineTuningApicreate_fine_tuning_jobPOST /fine_tuning/jobsCreates a fine-tuning job which begins the process of creating a new model from a given dataset. Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. Learn more about fine-tuning
OpenApiOpenAIClient::FineTuningApilist_fine_tuning_eventsGET /fine_tuning/jobs/{fine_tuning_job_id}/eventsGet status updates for a fine-tuning job.
OpenApiOpenAIClient::FineTuningApilist_fine_tuning_job_checkpointsGET /fine_tuning/jobs/{fine_tuning_job_id}/checkpointsList checkpoints for a fine-tuning job.
OpenApiOpenAIClient::FineTuningApilist_paginated_fine_tuning_jobsGET /fine_tuning/jobsList your organization's fine-tuning jobs
OpenApiOpenAIClient::FineTuningApiretrieve_fine_tuning_jobGET /fine_tuning/jobs/{fine_tuning_job_id}Get info about a fine-tuning job. Learn more about fine-tuning
OpenApiOpenAIClient::ImagesApicreate_imagePOST /images/generationsCreates an image given a prompt.
OpenApiOpenAIClient::ImagesApicreate_image_editPOST /images/editsCreates an edited or extended image given an original image and a prompt.
OpenApiOpenAIClient::ImagesApicreate_image_variationPOST /images/variationsCreates a variation of a given image.
OpenApiOpenAIClient::ModelsApidelete_modelDELETE /models/{model}Delete a fine-tuned model. You must have the Owner role in your organization to delete a model.
OpenApiOpenAIClient::ModelsApilist_modelsGET /modelsLists the currently available models, and provides basic information about each one such as the owner and availability.
OpenApiOpenAIClient::ModelsApiretrieve_modelGET /models/{model}Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
OpenApiOpenAIClient::ModerationsApicreate_moderationPOST /moderationsClassifies if text is potentially harmful.

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

ApiKeyAuth

  • Type: Bearer authentication

FAQs

Package last updated on 15 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc