Skip to content

Instantly share code, notes, and snippets.

@link89
Created December 14, 2023 03:11
Show Gist options
  • Save link89/a2d3a45aacb3becb2f7d2c03aef870b5 to your computer and use it in GitHub Desktop.
Save link89/a2d3a45aacb3becb2f7d2c03aef870b5 to your computer and use it in GitHub Desktop.
POC: use typescript as container of structured data for LLM

POC: use typescript as container of structured data for LLM

Prompt

The following is Typescript code that describe the data structure of reactions. The reactions to be exported are not implement yet.

/**
 * This is a typescript prompt file to export reactions data.
 */

type NumberOrString = number | string;

interface Substance {
    name: string; // formal name of the substance
    mf: string;  // molecular formula
    cas?: string; // CAS number
    iupac?: string; // IUPAC name
    quantity?: NumberOrString; // quantity of the substance
}

interface Reactant extends Substance {
    converstionRate?: NumberOrString; // conversion rate of the reactant
}

interface Catalyst extends Substance {
    type: 'main' | 'co';
}

interface Solvent extends Substance {
}

interface BalanceGas extends Substance {
}

interface Product extends Substance {
    yield?: number; // yield of the product
}

interface Condition extends Substance {
    temperature?: NumberOrString; // temperature of the reaction
    pressure?: NumberOrString; // pressure of the reaction
    time?: NumberOrString; // time of the reaction
}

interface Reaction {
    conditions?: Condition;
    reactants: Reactant[];
    catalysts?: Catalyst[];
    solvents?: Solvent[];
    blanceGases?: BalanceGas[];
    products: Product[];
}


/**
 *  Add reactions to the list below, for example:
 *
 *  export const reactions: Reaction[] = [
 *      {
 *          reactants: [
 *              {
 *                  name: 'Benzene',
 *                  mf: 'C6H6',
 *                  cas: '71-43-2',
 *                  iupac: 'benzene'
 *              },
 *              {
 *                  name: 'Hydrogen',
 *                  mf: 'H2',
 *                  cas: '1333-74-0',
 *                  iupac: 'dihydrogen'
 *              }
 *          ],
 *          products: [
 *              {
 *                  name: 'Cyclohexane',
 *                  mf: 'C6H12',
 *                  cas: '110-82-7',
 *                  iupac: 'cyclohexane'
 *              }
 *          ]
 *      }
 *  ]
 *
 */

// TODO: export reactions
export const reactions: Reaction[] = [
]

Please complete the above code with the message extract from the following text:

The effect a 45 atom-thick overlayer of aluminum oxide, deposited by atomic layer deposition, was investigated on a 2.5 wt.% Pd/Al2O3 catalyst in which the Pd nanoparticles were encapsulated by the support consequent to the preparation method. The overlayer suppressed the activity for oxidative dehydrogenation of ethane, but it also effectively prevented metal sintering and suppressed coking for reactions at high temperatures. On the catalyst with the alumina overlayer, a steady activity was observed even at 600 °C and above when the gaseous oxygen was completely consumed, while attaining 70% selectivity for ethene at 38% conversion, versus 10% selectivity at comparable conversions without the overlayer. The overlayer preferentially deposited on edge Pd atoms, as indicated by preferentially suppression of the CO chemisorption peak at 2056 cm−1, which are responsible for coking. The high ethene selectivity at 675 °C could be due to coupled homogeneous and heterogeneous reactions at the high temperature, together with phase change of PdO to Pd.
For 45Al–Pd–PMHS/Al2O3, both the O2 and C2H6 conversions were low at 400 °C, and CO2 was the dominant product. The conversion of O2 increased rapidly above 500 °C, although the product selectivities did not change much. The conversion of C2H6 increased sharply above 650 °C, and the selectivity for C2H4 also increased rapidly to >70%, while the selectivity for CO2 dropped to <10% (). Interestingly, the selectivity for CH4 remained low, consistent with the lack of carbon deposit and its cracking on the catalyst. The conversion did not decrease with time. In a separate experiment, ethane conversion in the absence of oxygen on this catalyst was determined to be less than 7% at 675 °C. Thus, its contribution to the conversion in the oxidative process was minor.

Response

export const reactions: Reaction[] = [
  {
    conditions: {
      temperature: 600,
    },
    reactants: [
      {
        name: 'Aluminum Oxide',
        mf: 'Al2O3',
      },
      {
        name: 'Pd Nanoparticles',
        mf: 'Pd',
        quantity: '2.5 wt.%',
      },
      {
        name: 'Ethane',
        mf: 'C2H6',
      },
    ],
    products: [
      {
        name: 'Ethene',
        mf: 'C2H4',
        yield: 70,
      },
    ],
  },
  {
    conditions: {
      temperature: 400,
    },
    reactants: [
      {
        name: '45Al–Pd–PMHS/Al2O3',
        mf: 'Unknown',
      },
    ],
    products: [
      {
        name: 'CO2',
        mf: 'CO2',
      },
    ],
  },
  {
    conditions: {
      temperature: 650,
    },
    reactants: [
      {
        name: '45Al–Pd–PMHS/Al2O3',
        mf: 'Unknown',
      },
    ],
    products: [
      {
        name: 'C2H4',
        mf: 'C2H4',
        yield: 70,
      },
      {
        name: 'CO2',
        mf: 'CO2',
        yield: 10,
      },
    ],
  },
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment