Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing but required content length header for löve2d usage #19

Merged
merged 2 commits into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 29 additions & 0 deletions rockspecs/lua-genai-0.2.2-1.rockspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package = "lua-genai"
version = "0.2.2-1"
source = {
url = "https://github.com/emilrueh/lua-genai/archive/refs/tags/v0.2.2.tar.gz"
}
description = {
summary = "Generative AI SDK",
detailed = "Interface for generative AI providers like OpenAI, Anthropic, Google Gemini, DeepSeek, etc. abstracting away provider-specific payload structures and response parsing to simplify switching models.",
homepage = "https://github.com/emilrueh/lua-genai",
license = "Zlib"
}
dependencies = {
"lua >= 5.1",
"lua-cjson",
"luasec"
}
build = {
type = "builtin",
modules = {
genai = "src/genai/init.lua",
["genai.features"] = "src/genai/features/init.lua",
["genai.features.chat"] = "src/genai/features/chat.lua",
["genai.genai"] = "src/genai/genai.lua",
["genai.providers"] = "src/genai/providers/init.lua",
["genai.providers.anthropic"] = "src/genai/providers/anthropic.lua",
["genai.providers.openai"] = "src/genai/providers/openai.lua",
["genai.utils"] = "src/genai/utils.lua"
}
}
2 changes: 1 addition & 1 deletion src/genai/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function utils.send_request(url, payload, method, headers, callback, exception_h
return chunk
end

-- if payload then headers["Content-Length"] = #payload end
if payload then headers["Content-Length"] = #payload end

local request_opts = {
url = url,
Expand Down