Commented out non-functional code
This commit is contained in:
parent
b69f169892
commit
0e2becc212
@ -72,24 +72,25 @@ class Response:
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from openai import OpenAI
|
||||
client = OpenAI()
|
||||
|
||||
test_system_message = Message(role='system', content=[InputText('Talk like an Italian mafia boss.')])
|
||||
test_user_message = Message(role='user', content=[InputText('Hi! How are you?')])
|
||||
test_prompt = Prompt(model='gpt-4.1-mini', input=[test_system_message, test_user_message])
|
||||
print(asdict(test_prompt))
|
||||
response_raw = client.responses.create(**asdict(test_prompt))
|
||||
response = Response(**filter_fields(response_raw.to_dict(), Response))
|
||||
print(asdict(response))
|
||||
test_prompt.add_message(response.output[0])
|
||||
|
||||
test_user_message_2 = Message(role='user', content=[
|
||||
InputText('Can you tell me what is on this picture?'),
|
||||
InputImage(image_url='https://upload.wikimedia.org/wikipedia/commons/f/f4/Piet_Mondriaan_-_Sinaasappelen_%28authentiek%29_-_A97_-_Piet_Mondrian%2C_catalogue_raisonn%C3%A9.jpg')
|
||||
])
|
||||
test_prompt.add_message(test_user_message_2)
|
||||
response_raw = client.responses.create(**asdict(test_prompt))
|
||||
response = Response(**filter_fields(response_raw.to_dict(), Response))
|
||||
test_prompt.add_message(response.output[0])
|
||||
print(asdict(test_prompt))
|
||||
pass
|
||||
# from openai import OpenAI
|
||||
# client = OpenAI()
|
||||
#
|
||||
# test_system_message = Message(role='system', content=[InputText('Talk like an Italian mafia boss.')])
|
||||
# test_user_message = Message(role='user', content=[InputText('Hi! How are you?')])
|
||||
# test_prompt = Prompt(model='gpt-4.1-mini', input=[test_system_message, test_user_message])
|
||||
# print(asdict(test_prompt))
|
||||
# response_raw = client.responses.create(**asdict(test_prompt))
|
||||
# response = Response(**filter_fields(response_raw.to_dict(), Response))
|
||||
# print(asdict(response))
|
||||
# test_prompt.add_message(response.output[0])
|
||||
#
|
||||
# test_user_message_2 = Message(role='user', content=[
|
||||
# InputText('Can you tell me what is on this picture?'),
|
||||
# InputImage(image_url='https://upload.wikimedia.org/wikipedia/commons/f/f4/Piet_Mondriaan_-_Sinaasappelen_%28authentiek%29_-_A97_-_Piet_Mondrian%2C_catalogue_raisonn%C3%A9.jpg')
|
||||
# ])
|
||||
# test_prompt.add_message(test_user_message_2)
|
||||
# response_raw = client.responses.create(**asdict(test_prompt))
|
||||
# response = Response(**filter_fields(response_raw.to_dict(), Response))
|
||||
# test_prompt.add_message(response.output[0])
|
||||
# print(asdict(test_prompt))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user