Skip to content

Conversation

@64bit
Copy link
Owner

@64bit 64bit commented Nov 25, 2025

Restructure project such that types for an API group are self contained - move shared types into shared folder and re-export them in the used modules.

For example ImageDetail type is used in responses and chat types - it is reexported from library as types::chat::ImageDetail and types::responses::ImageDetail.

Misc:

  • Group together related apis into a folder for better organization - for example src/admin contains all admin API groups, src/vectorstores contains all Vector store related API groups.
  • Move "Query" types ( used in for query params in list() call) in api.rs files.

@64bit 64bit merged commit 8ca8ac5 into main Nov 25, 2025
1 check passed
@64bit 64bit deleted the contain-types-and-traits branch November 25, 2025 00:36
@64bit 64bit restored the contain-types-and-traits branch November 25, 2025 00:36
@64bit 64bit deleted the contain-types-and-traits branch November 25, 2025 00:37
ifsheldon pushed a commit to ifsheldon/async-openai-wasm that referenced this pull request Nov 28, 2025
* pattern for shared types: FunctionObject

* shared FunctionName

* shared ResponseFormat and ResponseFormatJsonSchema

* shared ImageDetail

* shared ImageUrl

* shared FunctionCall

* consistent imports

* consistent imports

* consistent imports

* consistent impls for assistants

* cleanup OrganizationRole from common.rs

* rename assistant_stream.rs -> stream.rs

* rename audio_types.rs -> audio.rs

* shared LogProbProperties

* clean import

* shared ResponseUsage

* rename chat_types.rs -> chat.rs

* shared CustomGrammarFormatParam

* embedding impls in impls.rs

* shared ImageDetail in responses

* shared ReasoningEffort

* import cleanup

* shared CompletionTokenDetails and PromptTokenDetails

* shared Filter; ComparisonFilter; CompoundFilter

* shared StaticChunkingStrategy

* shared ImageInput

* shared::ImageInput in impls.rs

* mcp types in its own module

* completions in its own types::completions module

* updated completions examples

* fix responses example

* doc comment

* webhook.rs in its own types/webhooks

* move mcp.rs to types/mcp

* shared TranscriptionUsage

* cargo fmt

* fix test compilation

* rename tests

* Usage api under client.admin().usage() instead of client.usage()

* update admin usage example

* move admin APIs in admin src/admin

* move audio apis in src/audio

* move assistants apis in src/assistants

* vectore stores apis in src/vectorstores

* fix byot test from client.usage() to client.admin().usage()

* evals apis in src/evals

* move container and container files apis in src/containers

* move responses api to src/responses

* admin types consistent with rest of the crate

* cargo clippy change name of contained module

(cherry picked from commit 8ca8ac5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants