inc timeout

This commit is contained in:
ishaan-jaff 2023-07-31 17:20:07 -07:00
parent 5eab314ce5
commit 5b5bd59783

View file

@ -128,7 +128,7 @@ def get_optional_params(
####### COMPLETION ENDPOINTS ################ ####### COMPLETION ENDPOINTS ################
############################################# #############################################
@client @client
@func_set_timeout(60, allowOverride=True) ## https://pypi.org/project/func-timeout/ - timeouts, in case calls hang (e.g. Azure) @func_set_timeout(120, allowOverride=True) ## https://pypi.org/project/func-timeout/ - timeouts, in case calls hang (e.g. Azure)
def completion( def completion(
model, messages, # required params model, messages, # required params
# Optional OpenAI params: see https://platform.openai.com/docs/api-reference/chat/create # Optional OpenAI params: see https://platform.openai.com/docs/api-reference/chat/create
@ -136,7 +136,7 @@ def completion(
temperature=1, top_p=1, n=1, stream=False, stop=None, max_tokens=float('inf'), temperature=1, top_p=1, n=1, stream=False, stop=None, max_tokens=float('inf'),
presence_penalty=0, frequency_penalty=0, logit_bias={}, user="", presence_penalty=0, frequency_penalty=0, logit_bias={}, user="",
# Optional liteLLM function params # Optional liteLLM function params
azure=False, logger_fn=None, verbose=False *, forceTimeout=60, azure=False, logger_fn=None, verbose=False
): ):
try: try:
# check if user passed in any of the OpenAI optional params # check if user passed in any of the OpenAI optional params