본문 바로가기
728x90

ai3

gpt-3.5-turbo api 호출 $api_key = ""; $prompt = ""; $url = "https://api.openai.com/v1/chat/completions"; $data = array(     "model" => "gpt-3.5-turbo",     "messages" => array(         array(             "role" => "user",             "content" => $prompt         )     ),     "max_tokens" => 3000,     "temperature" => 0.5, ); $data_string = json_encode($data); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url.. 2023. 3. 8.
AI를 위한 파이썬 핵심문법-2 #dic01.py dict1={"name": "kim", "age":30} print(f"type(dict1): {type(dict1)}") print(f"dict1: { dict1 }") print(dict1["name"]) dict2=dict(name="lee", age=20) print(f"type(dict2): {type(dict2)}") print(f"dict1: { dict2 }") print(dict2["name"]) print() dictionary = { "name": "7D 건조 망고", "type": "당절임", "ingredient": ["망고", "설탕", "메타중아황산나트륨", "치자황색소"], "origin": "필리핀" } print(f"type(dictionary): {ty.. 2022. 5. 24.
AI를 위한 파이썬 핵심문법-1 Python -> 1991년 Guido van Rossum 이 개발 -> Script Language -> 컴파일 과정 없이 인터프리터에 의해 실행 결과를 바로 확인 https://www.python.org/downloads/ python keyword - 특별한 의미가 부여된 단어 - 숫자로 시작 불가 - False - break - else - if - not - while - None - class - except - import - or - with - True - continue - finally - in - pass - yield - and - def - for - is - raise - as - del - from - lambda - return - assert - elif - global .. 2022. 5. 24.
728x90