Skip to content

Commit

Permalink
update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
skyscrapr committed Aug 26, 2024
1 parent 5e56030 commit dd3abcc
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 14 deletions.
40 changes: 34 additions & 6 deletions docs/resources/assistant.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,44 @@ terraform {
}
}
# resource "openai_assistant" "test" {
# name = "tf-test-sample"
# description = "tf-test-sample"
# model = "gpt-4"
# instructions = "You are a personal math tutor. When asked a question, write and run Python code to answer the question."
# tools = [
# {
# type = "code_interpreter"
# }
# ]
# }
resource "openai_file" "test" {
filepath = "./test-fixtures/test.jsonl"
}
resource "openai_vector_store" "test" {
name = "test_vector_store"
file_ids = [
openai_file.test.id
]
}
resource "openai_assistant" "test" {
name = "tf-test-sample"
description = "tf-test-sample"
model = "gpt-4"
name = "test_assistant"
description = "my test assistant description"
model = "gpt-3.5-turbo"
instructions = "You are a personal math tutor. When asked a question, write and run Python code to answer the question."
tools = [
{
type = "code_interpreter"
}
{ type = "file_search" }
]
tool_resources = {
file_search = {
vector_store_ids = [
openai_vector_store.test.id,
]
}
}
}
```

Expand Down
16 changes: 15 additions & 1 deletion docs/resources/file.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,21 @@ description: |-

File resource


## Example Usage

```terraform
terraform {
required_providers {
openai = {
source = "skyscrapr/openai"
}
}
}
resource "openai_file" "test" {
filepath = "./test-fixtures/test.jsonl"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
23 changes: 22 additions & 1 deletion docs/resources/vector_store.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,28 @@ description: |-

VectorStore resource


## Example Usage

```terraform
terraform {
required_providers {
openai = {
source = "skyscrapr/openai"
}
}
}
resource "openai_file" "test" {
filepath = "./test-fixtures/test.jsonl"
}
resource "openai_vector_store" "test" {
name = "test_vector_store"
file_ids = [
openai_file.test.id
]
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
40 changes: 34 additions & 6 deletions examples/resources/openai_assistant/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,42 @@ terraform {
}
}

# resource "openai_assistant" "test" {
# name = "tf-test-sample"
# description = "tf-test-sample"
# model = "gpt-4"
# instructions = "You are a personal math tutor. When asked a question, write and run Python code to answer the question."
# tools = [
# {
# type = "code_interpreter"
# }
# ]
# }

resource "openai_file" "test" {
filepath = "./test-fixtures/test.jsonl"
}

resource "openai_vector_store" "test" {
name = "test_vector_store"
file_ids = [
openai_file.test.id
]
}

resource "openai_assistant" "test" {
name = "tf-test-sample"
description = "tf-test-sample"
model = "gpt-4"
name = "test_assistant"
description = "my test assistant description"
model = "gpt-3.5-turbo"
instructions = "You are a personal math tutor. When asked a question, write and run Python code to answer the question."
tools = [
{
type = "code_interpreter"
}
{ type = "file_search" }
]
tool_resources = {
file_search = {
vector_store_ids = [
openai_vector_store.test.id,
]
}
}
}
11 changes: 11 additions & 0 deletions examples/resources/openai_file/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
terraform {
required_providers {
openai = {
source = "skyscrapr/openai"
}
}
}

resource "openai_file" "test" {
filepath = "./test-fixtures/test.jsonl"
}
18 changes: 18 additions & 0 deletions examples/resources/openai_vector_store/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
terraform {
required_providers {
openai = {
source = "skyscrapr/openai"
}
}
}

resource "openai_file" "test" {
filepath = "./test-fixtures/test.jsonl"
}

resource "openai_vector_store" "test" {
name = "test_vector_store"
file_ids = [
openai_file.test.id
]
}

0 comments on commit dd3abcc

Please sign in to comment.