Skip to content
Merged

Dev #39

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
19efc8f
start the 'vignette-first' development workflow for the Asynchronous …
jpcompartir Jan 5, 2026
10449bf
Continue outline of batch workflow in the sync_async vignette
jpcompartir Jan 5, 2026
fe17415
add the 50k limit explanation and then start on the code for creating…
jpcompartir Jan 5, 2026
f739ed2
bump vers
jpcompartir Jan 5, 2026
ec5b376
remove badges from README text
jpcompartir Jan 6, 2026
40baf0c
add func for preparing a batch of json rows for embeddings
jpcompartir Jan 6, 2026
5866774
add conveniece helpers for oai files API
jpcompartir Jan 6, 2026
0a1eebb
add oai_batch_file_upload
jpcompartir Jan 6, 2026
5330bac
split files api and batch api into separate docs in package (for clar…
jpcompartir Jan 7, 2026
6e0a34c
add oai_file_content to retrieve a file's contents here main intentio…
jpcompartir Jan 9, 2026
a71bd2e
fix batch upload file/creation function
jpcompartir Jan 9, 2026
295cce9
Get list of all batches in the API under our org
jpcompartir Jan 9, 2026
5a1a684
make sure id is a string in
jpcompartir Jan 9, 2026
0a71bc4
commit validation func and add to main body
jpcompartir Jan 9, 2026
ad0e3e2
add batch job creation trigger func once file is uploaded
jpcompartir Jan 9, 2026
e2f8614
parse embedding reuslts function
jpcompartir Jan 9, 2026
62a9db3
Add status function for batches
jpcompartir Jan 12, 2026
f90e4d9
Add section headers for navigation prior to documenting and building …
jpcompartir Jan 12, 2026
f0cc983
add build completionn req func mainbody
jpcompartir Jan 13, 2026
9395c0e
add batch_prepare completions main body
jpcompartir Jan 13, 2026
9c442ef
add batch_parse_completions main body
jpcompartir Jan 13, 2026
1736d13
add roxygen2 outlines and some of the completed docs for batch functions
jpcompartir Jan 13, 2026
c543453
add start of tests for batch API
jpcompartir Jan 13, 2026
ab826dd
continue batch tests - end embeddings & start completions
jpcompartir Jan 13, 2026
e60f0da
add roxygen2 skeletons to files API functions
jpcompartir Jan 13, 2026
09a7e50
add batch and file functions to _pkgdown.yml in sections
jpcompartir Jan 13, 2026
7680953
fix broken link in version releases for news/pkgdown.yml
jpcompartir Jan 13, 2026
69bd2ad
standardise param names and descriptions in openai_batch_api.R
jpcompartir Jan 13, 2026
e18e5ad
add roxygen2 docs and examples to openai_files_api docs
jpcompartir Jan 13, 2026
b7b762f
save vignette progress and dev docs
jpcompartir Jan 13, 2026
69c0e8f
add tests for completions in batch API
jpcompartir Jan 13, 2026
35ea08f
Make sure we call completions_req after namechange
jpcompartir Jan 13, 2026
6679438
Update vignette with code for quickstarts, just need to finish the prose
jpcompartir Jan 13, 2026
f80e4aa
Patch the inherits (need to S7::S7_inherits, been stung by this befor…
jpcompartir Jan 13, 2026
58615cc
Add Claudy to authors
jpcompartir Jan 14, 2026
e0b5e8a
rename oai_batch_file_upload -> oai_batch_upload
jpcompartir Jan 14, 2026
14fddf6
change oai_batch_file_upload pointers in docs to oai_batch_upload
jpcompartir Jan 14, 2026
95b4127
add curl to dependencies (for file upload)
jpcompartir Jan 14, 2026
5f51275
re-work, re-organise and reformat the sync_async vignette
jpcompartir Jan 14, 2026
9908d94
Merge branch 'main' into dev
jpcompartir Jan 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
Package: EndpointR
Title: Connects to various Machine Learning inference providers
Version: 0.2
Authors@R:
person("Jack", "Penzer", , "Jack.penzer@sharecreative.com", role = c("aut", "cre"))
Version: 0.2.1
Authors@R: c(
person("Jack", "Penzer", , "Jack.penzer@sharecreative.com", role = c("aut", "cre")),
person("Claude", "AI", role = "aut")
)
Description: EndpointR is a 'batteries included', open-source R package for connecting to various APIs for Machine Learning model predictions. EndpointR is built for company-specific use cases, so may not be useful to a wide audience.
License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
RoxygenNote: 7.3.3
Suggests:
spelling,
broom,
Expand All @@ -33,7 +35,8 @@ Imports:
tibble,
S7,
jsonvalidate,
arrow
arrow,
curl
VignetteBuilder: knitr
Depends:
R (>= 3.5)
Expand Down
15 changes: 15 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ export(hf_get_model_max_length)
export(hf_perform_request)
export(json_dump)
export(json_schema)
export(oai_batch_build_completions_req)
export(oai_batch_build_embed_req)
export(oai_batch_cancel)
export(oai_batch_list)
export(oai_batch_parse_completions)
export(oai_batch_parse_embeddings)
export(oai_batch_prepare_completions)
export(oai_batch_prepare_embeddings)
export(oai_batch_start)
export(oai_batch_status)
export(oai_batch_upload)
export(oai_build_completions_request)
export(oai_build_completions_request_list)
export(oai_build_embedding_request)
Expand All @@ -32,6 +43,10 @@ export(oai_embed_batch)
export(oai_embed_chunks)
export(oai_embed_df)
export(oai_embed_text)
export(oai_file_content)
export(oai_file_delete)
export(oai_file_list)
export(oai_file_upload)
export(perform_requests_with_strategy)
export(process_response)
export(safely_from_json)
Expand Down
34 changes: 33 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,36 @@
# EndpointR 0.2
# EndpointR 0.2.1

## OpenAI Batch API

Adds support for OpenAI's asynchronous Batch API, offering 50% cost savings and higher rate limits compared to synchronous endpoints. Ideal for large-scale embeddings, classifications, and batch inference tasks.

**Request preparation:**

- `oai_batch_build_embed_req()` - Build a single embedding request row
- `oai_batch_prepare_embeddings()` - Prepare an entire data frame for batch embeddings
- `oai_batch_build_completions_req()` - Build a single chat completions request row
- `oai_batch_prepare_completions()` - Prepare an entire data frame for batch completions (supports structured outputs via JSON schema)

**Job management:**

- `oai_batch_upload()` - Upload prepared JSONL to OpenAI Files API
- `oai_batch_start()` - Trigger a batch job on an uploaded file
- `oai_batch_status()` - Check the status of a running batch job
- `oai_batch_list()` - List all batch jobs associated with your API key
- `oai_batch_cancel()` - Cancel an in-progress batch job

**Results parsing:**

- `oai_batch_parse_embeddings()` - Parse batch embedding results into a tidy data frame
- `oai_batch_parse_completions()` - Parse batch completion results into a tidy data frame

## OpenAI Files API

- `oai_file_list()` - List files uploaded to the OpenAI Files API
- `oai_file_content()` - Retrieve the content of a file (e.g., batch results)
- `oai_file_delete()` - Delete a file from the Files API

# EndpointR 0.2.0

- error message and status propagation improvement. Now writes .error, .error_msg (standardised across package), and .status. Main change is preventing httr2 eating the errors before we can deal with them
- adds parquet writing to oai_complete_df and oai_embed_df
Expand Down
Loading
Loading