我想要一天分享一點「LLM從底層堆疊的技術」,並且每篇文章長度控制在三分鐘以內,讓大家不會壓力太大,但是又能夠每天成長一點。
def dialog(uinput):
role = "user"
line = {"role": role, "content": uinput}
assert1 = {"role": "system", "content": "You are a Natural Language Processing Assistant for Semantic Role Labeling."}
assert2 = {"role": "assistant", "content": "You provide Semantic Role Labeling and display the result in a nice chart."}
assert3 = line
iprompt = []
iprompt.append(assert1)
iprompt.append(assert2)
iprompt.append(assert3)
client = OpenAI()
response = client.chat.completions.create(model = "gpt-4", messages = iprompt)
text = response.choices[0].message.content
return text