Skip to content

Commit

Permalink
added a sample for Monte Carlo Pi estimator
Browse files Browse the repository at this point in the history
  • Loading branch information
MoezBHH committed Aug 1, 2024
1 parent a13c0e4 commit 95df969
Show file tree
Hide file tree
Showing 3 changed files with 1,595 additions and 18 deletions.
23 changes: 7 additions & 16 deletions Context_Engineering4LF.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"Generate Lingua Franca (LF) code from natural language prompt.\n",
"\n",
"## Context\n",
"Large Language Models (LLMs) are a powerful tool for generating code. However, LLMs are often trained on standard programming languages like C/C++, Java, Python, and JavaScript. This makes it difficult to generate code in Domain-specific languages like Lingua Franca.\n",
"Large Language Models (LLMs) are a powerful tool for generating code. However, LLMs are often trained on standard programming languages like C/C++, Java, Python, or JavaScript. This makes it difficult to generate code in Domain-specific languages like Lingua Franca.\n",
"\n",
"This project shows how to curate context to guide the LLM. We demonstrate the technique by showing how to generate code that uses the Lingua Franca coordination language together with C and Python."
]
Expand Down Expand Up @@ -49,7 +49,7 @@
},
{
"cell_type": "code",
"execution_count": 125,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -75,7 +75,7 @@
},
{
"cell_type": "code",
"execution_count": 126,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -159,7 +159,7 @@
},
{
"cell_type": "code",
"execution_count": 127,
"execution_count": 3,
"metadata": {
"vscode": {
"languageId": "shellscript"
Expand Down Expand Up @@ -187,7 +187,7 @@
},
{
"cell_type": "code",
"execution_count": 128,
"execution_count": 4,
"metadata": {
"vscode": {
"languageId": "shellscript"
Expand Down Expand Up @@ -216,18 +216,9 @@
},
{
"cell_type": "code",
"execution_count": 130,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"LFGPT/without_context/DropSensor_gpt-4o_2.lf\n",
"LFGPT/without_context/DropSensor_gpt-3.5-turbo_2.lf\n"
]
}
],
"outputs": [],
"source": [
"# Initializes an OpenAI client for interacting with the OpenAI API.\n",
"client = OpenAI()\n",
Expand Down
Loading

0 comments on commit 95df969

Please sign in to comment.