mirror of
				https://github.com/ggml-org/llama.cpp.git
				synced 2025-10-30 08:42:00 +00:00 
			
		
		
		
	api_like_OAI.py : compat with Microsoft Guidance (#2746)
Check for None in addition to empty string check in all request params Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
This commit is contained in:
		| @@ -23,7 +23,13 @@ parser.add_argument("--port", type=int, help="Set the port to listen.(default: 8 | ||||
| args = parser.parse_args() | ||||
|  | ||||
| def is_present(json, key): | ||||
|     return key in json | ||||
|     try: | ||||
|         buf = json[key] | ||||
|     except KeyError: | ||||
|         return False | ||||
|     if json[key] == None: | ||||
|         return False | ||||
|     return True | ||||
|  | ||||
| #convert chat to prompt | ||||
| def convert_chat(messages): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Ryder Wishart
					Ryder Wishart