-
Notifications
You must be signed in to change notification settings - Fork 268
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
Added models_config and gateway to make it easy to switch betwe… #222
Conversation
model_config.parameters = {} | ||
return ChatOpenAI( | ||
model=model_config.name.split("/")[1], | ||
temperature=model_config.parameters.get("temperature", 0.1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add an optional model_kwargs
@@ -27,7 +26,6 @@ | |||
"query": "Explain in detail different categories of credit cards", | |||
"model_configuration": { | |||
"name": "openai-main/gpt-3-5-turbo", | |||
"provider": "truefoundry", | |||
"parameters": {"temperature": 0.1}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do think on changing this payload similar to ChatOpenAI?
model_config: {
- model_name
- provider
- temperature
- max_tokens
- model_kwargs
}
temperature and max_tokens can go within parameters if required?
backend/settings.py
Outdated
AI_GATEWAY = os.getenv("AI_GATEWAY", "openai") | ||
AI_GATEWAY_CONFIG = json.loads(os.getenv("AI_GATEWAY_CONFIG", "{}")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this used?
997ebe0
to
081d677
Compare
if not model_provider_config.api_key_env_var: | ||
api_key = None | ||
else: | ||
api_key = os.environ.get(model_provider_config.api_key_env_var, '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can use vars from settings.py?
…en models