Skip to content

Commit

Permalink
remove create_edit
Browse files Browse the repository at this point in the history
  • Loading branch information
roryl23 committed Sep 28, 2024
1 parent 38d6c93 commit b0ba988
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 53 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 0.10.0

* Removed deprecated features `create_edit` and `get_usage_statistics`

### 0.9.1

* Fixed a bug in `request_body` that prevented `query` argument from being passed to `HTTP.jl`.
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "OpenAI"
uuid = "e9f21f70-7185-4079-aca2-91159181367c"
authors = ["Rory Linehan @rory-linehan", "Marius Fersigan @algunion", "RexWzh @RexWzh", "Thatcher Chamberlin @ThatcherC", "Nicu Stiurca @nstiurca", "Peter @chengchingwen", "Stefan Wojcik @stefanjwojcik", "J S @svilupp", "Logan Kilpatrick @logankilpatrick", "Jerry Ling @Moelf"]
version = "0.9.1"
authors = ["Rory Linehan @rory-linehan", "Marius Fersigan @algunion", "RexWzh @RexWzh", "Thatcher Chamberlin @ThatcherC", "Nicu Stiurca @nstiurca", "Peter @chengchingwen", "Stefan Wojcik @stefanjwojcik", "J S @svilupp", "Logan Kilpatrick @logankilpatrick", "Jerry Ling @Moelf", "Cameron Pfiffer @cpfiffer"]
version = "0.10.0"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
4 changes: 0 additions & 4 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ create_completion(api_key::String, model_id::String; http_kwargs::NamedTuple=Nam
create_chat
```

```@docs
create_edit(api_key::String, model_id::String, instruction::String; http_kwargs::NamedTuple=NamedTuple(), kwargs...)
```

```@docs
create_embeddings(api_key::String, input, model_id::String=DEFAULT_EMBEDDING_MODEL_ID; http_kwargs::NamedTuple=NamedTuple(), kwargs...)
```
Expand Down
33 changes: 0 additions & 33 deletions src/OpenAI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -389,38 +389,6 @@ function create_chat(provider::AbstractOpenAIProvider,
kwargs...)
end

"""
Create edit
Note: This functionality is not accessible via API anymore -- see https://platform.openai.com/docs/deprecations
# Arguments:
- `api_key::String`: OpenAI API key
- `model_id::String`: Model id (e.g. "text-davinci-edit-001")
- `instruction::String`: The instruction that tells the model how to edit the prompt.
- `input::String` (optional): The input text to use as a starting point for the edit.
- `n::Int` (optional): How many edits to generate for the input and instruction.
# Keyword Arguments:
- `http_kwargs::NamedTuple` (optional): Keyword arguments to pass to HTTP.request.
For additional details about the endpoint, visit <https://platform.openai.com/docs/api-reference/edits>
"""
function create_edit(api_key::String,
model_id::String,
instruction::String;
http_kwargs::NamedTuple = NamedTuple(),
kwargs...)
@warn "This functionality is not accessible via API anymore -- see https://platform.openai.com/docs/deprecations"
return openai_request("edits",
api_key;
method = "POST",
http_kwargs = http_kwargs,
model = model_id,
instruction,
kwargs...)
end

"""
Create embeddings
Expand Down Expand Up @@ -567,7 +535,6 @@ export list_models
export retrieve_model
export create_chat
export create_completion
export create_edit
export create_embeddings
export create_images
export get_usage_status
Expand Down
14 changes: 0 additions & 14 deletions test/completion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,3 @@
@test false
end
end

# This functionality is not accessible via API anymore -- see https://platform.openai.com/docs/deprecations
@test_skip begin
@testset "create edit" begin
r = create_edit(ENV["OPENAI_API_KEY"],
"gpt-3.5-turbo-instruct",
"Fix this piece of text for grammatical errors",
input = "I hav ben riting sence i wuz 5")
println(r.response["choices"][begin]["text"])
if !=(r.status, 200)
@test false
end
end
end

0 comments on commit b0ba988

Please sign in to comment.