Skip to content

Commit b0ba988

Browse files
committed
remove create_edit
1 parent 38d6c93 commit b0ba988

File tree

5 files changed

+6
-53
lines changed

5 files changed

+6
-53
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### 0.10.0
2+
3+
* Removed deprecated features `create_edit` and `get_usage_statistics`
4+
15
### 0.9.1
26

37
* Fixed a bug in `request_body` that prevented `query` argument from being passed to `HTTP.jl`.

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "OpenAI"
22
uuid = "e9f21f70-7185-4079-aca2-91159181367c"
3-
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"]
4-
version = "0.9.1"
3+
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"]
4+
version = "0.10.0"
55

66
[deps]
77
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"

docs/src/index.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ create_completion(api_key::String, model_id::String; http_kwargs::NamedTuple=Nam
1616
create_chat
1717
```
1818

19-
```@docs
20-
create_edit(api_key::String, model_id::String, instruction::String; http_kwargs::NamedTuple=NamedTuple(), kwargs...)
21-
```
22-
2319
```@docs
2420
create_embeddings(api_key::String, input, model_id::String=DEFAULT_EMBEDDING_MODEL_ID; http_kwargs::NamedTuple=NamedTuple(), kwargs...)
2521
```

src/OpenAI.jl

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -389,38 +389,6 @@ function create_chat(provider::AbstractOpenAIProvider,
389389
kwargs...)
390390
end
391391

392-
"""
393-
Create edit
394-
395-
Note: This functionality is not accessible via API anymore -- see https://platform.openai.com/docs/deprecations
396-
397-
# Arguments:
398-
- `api_key::String`: OpenAI API key
399-
- `model_id::String`: Model id (e.g. "text-davinci-edit-001")
400-
- `instruction::String`: The instruction that tells the model how to edit the prompt.
401-
- `input::String` (optional): The input text to use as a starting point for the edit.
402-
- `n::Int` (optional): How many edits to generate for the input and instruction.
403-
404-
# Keyword Arguments:
405-
- `http_kwargs::NamedTuple` (optional): Keyword arguments to pass to HTTP.request.
406-
407-
For additional details about the endpoint, visit <https://platform.openai.com/docs/api-reference/edits>
408-
"""
409-
function create_edit(api_key::String,
410-
model_id::String,
411-
instruction::String;
412-
http_kwargs::NamedTuple = NamedTuple(),
413-
kwargs...)
414-
@warn "This functionality is not accessible via API anymore -- see https://platform.openai.com/docs/deprecations"
415-
return openai_request("edits",
416-
api_key;
417-
method = "POST",
418-
http_kwargs = http_kwargs,
419-
model = model_id,
420-
instruction,
421-
kwargs...)
422-
end
423-
424392
"""
425393
Create embeddings
426394
@@ -567,7 +535,6 @@ export list_models
567535
export retrieve_model
568536
export create_chat
569537
export create_completion
570-
export create_edit
571538
export create_embeddings
572539
export create_images
573540
export get_usage_status

test/completion.jl

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,3 @@
1111
@test false
1212
end
1313
end
14-
15-
# This functionality is not accessible via API anymore -- see https://platform.openai.com/docs/deprecations
16-
@test_skip begin
17-
@testset "create edit" begin
18-
r = create_edit(ENV["OPENAI_API_KEY"],
19-
"gpt-3.5-turbo-instruct",
20-
"Fix this piece of text for grammatical errors",
21-
input = "I hav ben riting sence i wuz 5")
22-
println(r.response["choices"][begin]["text"])
23-
if !=(r.status, 200)
24-
@test false
25-
end
26-
end
27-
end

0 commit comments

Comments
 (0)