terraform-provider-openai

command module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2023 License: MIT Imports: 5 Imported by: 0

README

Terraform Provider: OpenAI

The Terraform Provider for OpenAI is a plugin built using the Terraform Plugin Framework.

Requirements

Usage

NOTE: To use the OpenAI provider, set your OpenAI API key as the OPENAI_APIKEY environment variable.

terraform {
required_providers {
    openai = {
      source  = "registry.terraform.io/vravind1/openai"    
      version = "0.1.0".  // use the appropriate version
    }
  }
}

data "openai_completion" "example" {
  model      = "text-davinci-003"
  max_tokens = 16
  prompt     = "which is the best cloud provider?"
}

output "example_response" {
  value = data.openai_completion.example.result
}

output "example_tokens" {
  value = data.openai_completion.example.total_tokens
}

output "example_reason" {
  value = data.openai_completion.example.finish_reason
}

More details on how to use this provider can be found on the Terraform Registry.

License

MIT License

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL