Merge pull request #1 from arcrank/arcrank-patch-1

Update api_like_OAI.py simplify function
This commit is contained in:
arcrank 2023-08-25 14:11:27 -04:00 committed by GitHub
commit ef6dc874dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,13 +23,7 @@ parser.add_argument("--port", type=int, help="Set the port to listen.(default: 8
args = parser.parse_args() args = parser.parse_args()
def is_present(json, key): def is_present(json, key):
try: return key in json
buf = json[key]
except KeyError:
return False
return True
#convert chat to prompt #convert chat to prompt
def convert_chat(messages): def convert_chat(messages):