@@ -376,12 +376,12 @@ def _end_request(self, status_code: int):
376376
377377def get_model_request_response (path ):
378378 prompt = "Describe the purpose of a 'hello world' program in one line."
379- modelId = ""
379+ model_id = ""
380380 request_body = {}
381381 response_body = {}
382382
383383 if "amazon.titan" in path :
384- modelId = "amazon.titan-text-premier-v1:0"
384+ model_id = "amazon.titan-text-premier-v1:0"
385385
386386 request_body = {
387387 "inputText" : prompt ,
@@ -405,7 +405,7 @@ def get_model_request_response(path):
405405 }
406406
407407 if "anthropic.claude" in path :
408- modelId = "anthropic.claude-v2:1"
408+ model_id = "anthropic.claude-v2:1"
409409
410410 request_body = {
411411 "anthropic_version" : "bedrock-2023-05-31" ,
@@ -429,14 +429,14 @@ def get_model_request_response(path):
429429 }
430430
431431 if "meta.llama" in path :
432- modelId = "meta.llama2-13b-chat-v1"
432+ model_id = "meta.llama2-13b-chat-v1"
433433
434434 request_body = {"prompt" : prompt , "max_gen_len" : 512 , "temperature" : 0.5 , "top_p" : 0.9 }
435435
436436 response_body = {"prompt_token_count" : 31 , "generation_token_count" : 49 , "stop_reason" : "stop" }
437437
438438 if "cohere.command" in path :
439- modelId = "cohere.command-r-v1:0"
439+ model_id = "cohere.command-r-v1:0"
440440
441441 request_body = {
442442 "chat_history" : [],
@@ -456,7 +456,7 @@ def get_model_request_response(path):
456456 }
457457
458458 if "ai21.jamba" in path :
459- modelId = "ai21.jamba-1-5-large-v1:0"
459+ model_id = "ai21.jamba-1-5-large-v1:0"
460460
461461 request_body = {
462462 "messages" : [
@@ -482,7 +482,7 @@ def get_model_request_response(path):
482482 }
483483
484484 if "mistral" in path :
485- modelId = "mistral.mistral-7b-instruct-v0:2"
485+ model_id = "mistral.mistral-7b-instruct-v0:2"
486486
487487 request_body = {
488488 "prompt" : prompt ,
@@ -502,7 +502,7 @@ def get_model_request_response(path):
502502
503503 json_bytes = json .dumps (response_body ).encode ("utf-8" )
504504
505- return modelId , json .dumps (request_body ), StreamingBody (BytesIO (json_bytes ), len (json_bytes ))
505+ return model_id , json .dumps (request_body ), StreamingBody (BytesIO (json_bytes ), len (json_bytes ))
506506
507507
508508def set_main_status (status : int ) -> None :
0 commit comments