Update app.py
Browse files146 unmodified lines1471481491501511521537 unmodified lines1611621631641651661671681691701711721731744 unmodified lines179180181182183184185186187188189190191146 unmodified lines],response_format=FarmActivities,)farm_generated_json = farm_info_response.choices[0].message.parsedprint(farm_generated_json) # debugging7 unmodified lines],response_format=Interactions,)interactions_generated_json = interactions_response.choices[0].message.parsedprint(interactions_generated_json) # debugging 2interactions_pretty_json = interactions_generated_json.json()if 'error' in response:raise ValueError(f"API error: {response['error']['message']}")trial_response = client.beta.chat.completions.parse(model=model_version, # Use GPT model that supports structured output4 unmodified linesresponse_format=Trial,)trial_generated_json = trial_response.choices[0].message.parsedprint(trial_generated_json) # debugging 2trial_pretty_json = trial_generated_json.json()if 'error' in response:raise ValueError(f"API error: {response['error']['message']}")return farm_pretty_json, interactions_pretty_json, trial_pretty_json146 unmodified lines1471481491501511521531541551567 unmodified lines1641651661671681691701711721731741751761771784 unmodified lines183184185186187188189190191192193194195196146 unmodified lines],response_format=FarmActivities,)if 'error' in farm_info_response:raise ValueError(f"API error: {interactions_response['error']['message']}")farm_generated_json = farm_info_response.choices[0].message.parsedprint(farm_generated_json) # debugging7 unmodified lines],response_format=Interactions,)if 'error' in interactions_response:raise ValueError(f"API error: {interactions_response['error']['message']}")interactions_generated_json = interactions_response.choices[0].message.parsedprint(interactions_generated_json) # debugging 2interactions_pretty_json = interactions_generated_json.json()trial_response = client.beta.chat.completions.parse(model=model_version, # Use GPT model that supports structured output4 unmodified linesresponse_format=Trial,)if 'error' in trial_response:raise ValueError(f"API error: {trial_response['error']['message']}")trial_generated_json = trial_response.choices[0].message.parsedprint(trial_generated_json) # debugging 2trial_pretty_json = trial_generated_json.json()return farm_pretty_json, interactions_pretty_json, trial_pretty_json
app.py+11-6