Skip to content

Instantly share code, notes, and snippets.

View edelprino's full-sized avatar

Ettore Delprino edelprino

View GitHub Profile
from openai import OpenAI
import json
client = OpenAI(api_key="***************************")
SQL_MANAGER_PROMPT = """
You are the best SQL expert in the world and I need your help.
I want you to execute the request I will make from human language to a syntactically correct SQL query for MySQL 5.7.
Below I will provide you with the description of the tables so that you can understand which fields are being talked about in the request and produce correct queries:
Table `events`:
@edelprino
edelprino / DealPersisterJob.php
Created October 9, 2013 14:10
XPugMilano - Refactoring
if(null === $dealSaved)
{
$dealRepository->saveDeal($deal);
$apiCaller->setDeal($deal)->callFromGrab();
$this->addImageCacher($deal->getImage(), $deal->getId(), $couponer->getKey());
}
else
{
if(!$dealSaved->isEqual($deal)) //There are some differences
@edelprino
edelprino / geocoder.yml
Last active December 16, 2015 14:49
Geocoder Symfony2 Service Container configuration file
parameters:
geocoder.class: Geocoder\Geocoder
geocoder.provider.google.class: Geocoder\Provider\GoogleMapsProvider
geocoder.provider.openstreetmaps.class: Geocoder\Provider\OpenStreetMapsProvider
geocoder.adapter.curl.class: Geocoder\HttpAdapter\CurlHttpAdapter
services:
geocoder.adapter:
class: %geocoder.adapter.curl.class%
public: false