mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-25 13:07:58 +00:00
standard-tests[patch]: test init from env vars (#25983)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"""Standard LangChain interface tests"""
|
||||
|
||||
from typing import Type
|
||||
from typing import Tuple, Type
|
||||
|
||||
from langchain_core.language_models import BaseChatModel
|
||||
from langchain_standard_tests.unit_tests import ChatModelUnitTests
|
||||
@@ -12,3 +12,21 @@ class TestOpenAIStandard(ChatModelUnitTests):
|
||||
@property
|
||||
def chat_model_class(self) -> Type[BaseChatModel]:
|
||||
return ChatOpenAI
|
||||
|
||||
@property
|
||||
def init_from_env_params(self) -> Tuple[dict, dict, dict]:
|
||||
return (
|
||||
{
|
||||
"OPENAI_API_KEY": "api_key",
|
||||
"OPENAI_ORGANIZATION": "org_id",
|
||||
"OPENAI_API_BASE": "api_base",
|
||||
"OPENAI_PROXY": "https://proxy.com",
|
||||
},
|
||||
{},
|
||||
{
|
||||
"openai_api_key": "api_key",
|
||||
"openai_organization": "org_id",
|
||||
"openai_api_base": "api_base",
|
||||
"openai_proxy": "https://proxy.com",
|
||||
},
|
||||
)
|
||||
|
Reference in New Issue
Block a user