File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616- Added a launcher function ` launch ` to make it easier to launch the app.
1717- Semantic caching enabled by SemanticCaches.jl. You can change it by setting ` cached=false ` in the ` launch() ` function.
1818
19+ ### Fixed
20+ - Fixed a bug when caching would error for certain types of HTTP body (eg, ` IOBuffer ` )
21+
22+
1923## [ 0.3.0]
2024
2125### Added
Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ const HASH_CACHE = HashCache()
3232function cache_layer (handler)
3333 return function (req; kw... )
3434 VERBOSE = Base. get (ENV , " CACHES_VERBOSE" , " true" ) == " true"
35- if req. method == " POST" && ! isempty (req. body)
35+ has_body = (req. body isa IOBuffer ||
36+ (req. body isa AbstractVector && ! isempty (req. body)))
37+ if req. method == " POST" && has_body
3638 body = JSON3. read (copy (req. body))
3739 # # chat/completions is for OpenAI, v1/messages is for Anthropic
3840 if occursin (" v1/chat/completions" , req. target) ||
You can’t perform that action at this time.
0 commit comments