Sha256: b644f9b63461e891bac1379b4f3cdf9876fbe86066c551ab42ef64f76cdc9f15

Contents?: true

Size: 914 Bytes

Versions: 2

Compression:

Stored size: 914 Bytes

Contents

module OpenAI
  class Runs
    def initialize(client:)
      @client = client.beta(assistants: "v2")
    end

    def list(thread_id:)
      @client.get(path: "/threads/#{thread_id}/runs")
    end

    def retrieve(thread_id:, id:)
      @client.get(path: "/threads/#{thread_id}/runs/#{id}")
    end

    def create(thread_id:, parameters: {})
      @client.json_post(path: "/threads/#{thread_id}/runs", parameters: parameters)
    end

    def modify(id:, thread_id:, parameters: {})
      @client.json_post(path: "/threads/#{thread_id}/runs/#{id}", parameters: parameters)
    end

    def cancel(id:, thread_id:)
      @client.post(path: "/threads/#{thread_id}/runs/#{id}/cancel")
    end

    def submit_tool_outputs(thread_id:, run_id:, parameters: {})
      @client.json_post(path: "/threads/#{thread_id}/runs/#{run_id}/submit_tool_outputs",
                        parameters: parameters)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-openai-transitory-v2-6.5.3 lib/openai/runs.rb
ruby-openai-transitory-v2-6.5.2 lib/openai/runs.rb