Skip to content

Commit

Permalink
Host header is not in specs
Browse files Browse the repository at this point in the history
Ref:
- https://platform.openai.com/docs/api-reference/making-requests

Instead, we should implement the ability to include arbitrary headers
  • Loading branch information
johnd0e committed Apr 17, 2024
1 parent 7252fb3 commit f9a2559
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions openai/init.moon
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ unpack = table.unpack or unpack

import types from require "tableshape"

parse_url = require("socket.url").parse

empty = (types.nil + types.literal(cjson.null))\describe "nullable"

content_format = types.string + types.array_of types.one_of {
Expand Down Expand Up @@ -364,7 +362,6 @@ class OpenAI
cjson.encode payload

headers = {
"Host": parse_url(@api_base).host
"Accept": "application/json"
"Content-Type": "application/json"
"Content-Length": body and #body or nil
Expand Down

0 comments on commit f9a2559

Please sign in to comment.