Experimented with more convenient (although, less explicit) way of passing data into abstract dataclasses.
This commit is contained in:
parent
89b98fc5af
commit
ad59a695af
@ -80,7 +80,7 @@ if __name__ == '__main__':
|
||||
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])
|
||||
response = client.responses.create(**asdict(test_prompt))
|
||||
response_output = response.to_dict().get('output', [''])[0]
|
||||
response_output = response.output[0].to_dict()
|
||||
response_message = Message(**filter_fields(response_output, Message))
|
||||
print(response.to_dict().get('output'))
|
||||
test_prompt.add_message(response_message)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user