Skip to content

Commit

Permalink
Pass api_key to ChatOpenAI object
Browse files Browse the repository at this point in the history
Signed-off-by: thepetk <thepetk@gmail.com>
  • Loading branch information
thepetk committed Oct 6, 2024
1 parent c6daa30 commit e192e2a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def memory():
options=models)

llm = ChatOpenAI(base_url=model_service,
api_key="sk-no-key-required",
api_key="sk-no-key-required" if model_service_bearer is None else model_service_bearer,
model=model_name,
streaming=True,
callbacks=[StreamlitCallbackHandler(st.empty(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def checking_model_service():

llm = ChatOpenAI(base_url=model_service,
model=model_name,
api_key="EMPTY",
api_key="EMPTY" if model_service_bearer is None else model_service_bearer,
streaming=True)

# Define the Langchain chain
Expand Down

0 comments on commit e192e2a

Please sign in to comment.