lyleokoth commited on
Commit
81c82b6
1 Parent(s): 51b05ba

Upload 151 files

Browse files
06f15523-2eb9-4269-b9aa-b4399fe864a0.png ADDED

Git LFS Details

  • SHA256: 468d91fabdf4cf1929053a9c2ae702ec4606820964a2c8bdbe9e5409ef90f586
  • Pointer size: 131 Bytes
  • Size of remote file: 243 kB
1663d19f-2b5a-4417-9ec6-0484256f288a.png ADDED

Git LFS Details

  • SHA256: 38495bc0c69b720ec31b900f2a1398669ffa9788f782d2c90c4480243fc29185
  • Pointer size: 131 Bytes
  • Size of remote file: 119 kB
4644dc7c-254e-454e-b80e-2c5196e29756.png ADDED

Git LFS Details

  • SHA256: d9dbd099e13870f1887571bd85bdb0a86957e877fe4e7df365ffecf58ce25977
  • Pointer size: 130 Bytes
  • Size of remote file: 90.3 kB
4d49e77c-734c-469a-9baf-83bbb60ee623.png ADDED

Git LFS Details

  • SHA256: e966bdfea83e48196cfe0de15416702f94060bcc919af96be7160c5617b0e483
  • Pointer size: 131 Bytes
  • Size of remote file: 185 kB
651e6fca-31d2-4e7d-bd07-8930ba48fb17.png ADDED

Git LFS Details

  • SHA256: e8a774030a4e968a2cd2c73c0adc95ea326e3acbc1f983944846df0764144d83
  • Pointer size: 130 Bytes
  • Size of remote file: 40.3 kB
671ef76a-7d26-431c-aa5c-cdf86a98ca3d.png ADDED

Git LFS Details

  • SHA256: aed58e41787ece103dc2e86a0e800be447a85554e0435e281f69917b3d56a96b
  • Pointer size: 131 Bytes
  • Size of remote file: 186 kB
6732d021-02cf-4351-a5c6-7e8b10869ac4.png ADDED

Git LFS Details

  • SHA256: c6b97969e879b66a712155855c0cc214983578f8c7b9fb9b79e193e76b97418b
  • Pointer size: 129 Bytes
  • Size of remote file: 4.45 kB
94a57345-7ff3-4eee-bdbe-24265d8ba41b.png ADDED

Git LFS Details

  • SHA256: 8db72441a5c91146f6cda9b5bb7c5670a2ddb822b088501c4e94c2192bee3db9
  • Pointer size: 131 Bytes
  • Size of remote file: 384 kB
b7cce6e2-e6d4-461f-888b-6373790d2fef.png ADDED

Git LFS Details

  • SHA256: 6412cb58b059fd7b15741cd0ee60f1dab0deaccf01a8d43afcbad1bc378f3426
  • Pointer size: 130 Bytes
  • Size of remote file: 41 kB
b8540c6d-1e87-47fc-94ee-d7a88a1357f4.png ADDED

Git LFS Details

  • SHA256: c6b97969e879b66a712155855c0cc214983578f8c7b9fb9b79e193e76b97418b
  • Pointer size: 129 Bytes
  • Size of remote file: 4.45 kB
bd946ac6-ec8c-4eb7-8a99-35efb0124030.png ADDED

Git LFS Details

  • SHA256: 3e1f00d7fd9d542f72fdde4a06c8b99e604dec8a9c1d2ace6cacb12257c412e2
  • Pointer size: 131 Bytes
  • Size of remote file: 144 kB
ccdaa8c9-81dc-498a-9046-721417fb0ed3.png ADDED

Git LFS Details

  • SHA256: ff02f463ec2db08ad69e8d137c0743b3d3acf6f4d0abdbf88b2380d7577e3b2f
  • Pointer size: 130 Bytes
  • Size of remote file: 65.1 kB
e90744fe-7903-4e1a-ac5a-9d20c33141ca.png ADDED

Git LFS Details

  • SHA256: aac3fd4ee95aed6df1d0ccfd436a14d34eb8a21f1a3c965b12b9f97d034f7ef1
  • Pointer size: 131 Bytes
  • Size of remote file: 363 kB
f2826d96-90ea-4cfc-88a4-a583d653f6e1.png ADDED

Git LFS Details

  • SHA256: 144eab7608877e69c222c3d216283351eea5f83eb4cc185057e90cee292246bb
  • Pointer size: 130 Bytes
  • Size of remote file: 38.7 kB
f28cb5a0-9737-47f2-ba41-3e44e13e135c.png ADDED

Git LFS Details

  • SHA256: e287b991f2f8834133d6869210536aa965c0897401b36fcb8e89d1212762b67e
  • Pointer size: 131 Bytes
  • Size of remote file: 302 kB
f41c87d8-b0ea-4870-bd06-9af3c653e6de.png ADDED

Git LFS Details

  • SHA256: ebdc9cdc20dedd1a7cb95494e06620d83006b82a59cca64d1500ab6ae7c94894
  • Pointer size: 131 Bytes
  • Size of remote file: 264 kB
metadata.jsonl CHANGED
@@ -132,3 +132,19 @@
132
  {"file_name": "ca33b991-977a-4b3d-9bae-5b8671c8e5c6.png", "messages": [{"role": "SYSTEM", "content": "You are a helpful assistant that knows how to extract python code from images."}, {"role": "USER", "content": "Extract python code from the given image."}, {"role": "ASSISTANT", "content": "from datetime import datetime\r\n\r\nfrom sqlalchemy import ForeignKey\r\nfrom sqlalchemy.orm import Mapped, mapped_column, relationship\r\n\r\nfrom ..database import Base\r\n\r\n\r\nclass Post(Base):\r\n __tablename__ = \"posts\"\r\n\r\n id: Mapped[str] = mapped_column(primary_key=True)\r\n author_id: Mapped[str] = mapped_column(ForeignKey(\"users.id\"))\r\n location: Mapped[str]\r\n text: Mapped[str]\r\n image_url: Mapped[str]\r\n date_published: Mapped[datetime] = mapped_column(default_factory=datetime.utcnow)\r\n date_updated: Mapped[datetime] = mapped_column(\r\n onupdate=datetime.utcnow, default_factory=datetime.utcnow\r\n )\r\n\r\n author = relationship(\"User\", back_populates=\"posts\")\r\n bookmarks = relationship(\"Bookmark\", back_populates=\"post\")\r\n likes = relationship(\"Like\", back_populates=\"post\")\r\n comments = relationship(\"Comment\", back_populates=\"post\")\r\n views = relationship(\"View\", back_populates=\"post\")\r\n"}]}
133
  {"file_name": "404e2ab5-6feb-4531-81f0-9ac6edd14064.png", "messages": [{"role": "SYSTEM", "content": "You are a helpful assistant that knows how to extract python code from images."}, {"role": "USER", "content": "Extract python code from the given image."}, {"role": "ASSISTANT", "content": "from .bookmark import Bookmark\r\nfrom .comment import Comment\r\nfrom .like import Like\r\nfrom .post import Post\r\nfrom .user import User\r\nfrom .view import View\r\n"}]}
134
  {"file_name": "d874be25-1ac6-4b36-8272-cbb5428ab3e9.png", "messages": [{"role": "SYSTEM", "content": "You are a helpful assistant that knows how to extract python code from images."}, {"role": "USER", "content": "Extract python code from the given image."}, {"role": "ASSISTANT", "content": "from datetime import datetime\r\n\r\nfrom sqlalchemy import ForeignKey\r\nfrom sqlalchemy.orm import Mapped, mapped_column, relationship\r\n\r\nfrom ..database import Base\r\n\r\n\r\nclass View(Base):\r\n __tablename__ = \"views\"\r\n\r\n id: Mapped[str] = mapped_column(primary_key=True)\r\n author_id: Mapped[str] = mapped_column(ForeignKey(\"users.id\"))\r\n post_id: Mapped[str] = mapped_column(ForeignKey(\"posts.id\"))\r\n view_date: Mapped[datetime] = mapped_column(default_factory=datetime.utcnow)\r\n\r\n author = relationship(\"User\", back_populates=\"views\")\r\n post = relationship(\"Post\", back_populates=\"views\")\r\n"}]}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
  {"file_name": "ca33b991-977a-4b3d-9bae-5b8671c8e5c6.png", "messages": [{"role": "SYSTEM", "content": "You are a helpful assistant that knows how to extract python code from images."}, {"role": "USER", "content": "Extract python code from the given image."}, {"role": "ASSISTANT", "content": "from datetime import datetime\r\n\r\nfrom sqlalchemy import ForeignKey\r\nfrom sqlalchemy.orm import Mapped, mapped_column, relationship\r\n\r\nfrom ..database import Base\r\n\r\n\r\nclass Post(Base):\r\n __tablename__ = \"posts\"\r\n\r\n id: Mapped[str] = mapped_column(primary_key=True)\r\n author_id: Mapped[str] = mapped_column(ForeignKey(\"users.id\"))\r\n location: Mapped[str]\r\n text: Mapped[str]\r\n image_url: Mapped[str]\r\n date_published: Mapped[datetime] = mapped_column(default_factory=datetime.utcnow)\r\n date_updated: Mapped[datetime] = mapped_column(\r\n onupdate=datetime.utcnow, default_factory=datetime.utcnow\r\n )\r\n\r\n author = relationship(\"User\", back_populates=\"posts\")\r\n bookmarks = relationship(\"Bookmark\", back_populates=\"post\")\r\n likes = relationship(\"Like\", back_populates=\"post\")\r\n comments = relationship(\"Comment\", back_populates=\"post\")\r\n views = relationship(\"View\", back_populates=\"post\")\r\n"}]}
133
  {"file_name": "404e2ab5-6feb-4531-81f0-9ac6edd14064.png", "messages": [{"role": "SYSTEM", "content": "You are a helpful assistant that knows how to extract python code from images."}, {"role": "USER", "content": "Extract python code from the given image."}, {"role": "ASSISTANT", "content": "from .bookmark import Bookmark\r\nfrom .comment import Comment\r\nfrom .like import Like\r\nfrom .post import Post\r\nfrom .user import User\r\nfrom .view import View\r\n"}]}
134
  {"file_name": "d874be25-1ac6-4b36-8272-cbb5428ab3e9.png", "messages": [{"role": "SYSTEM", "content": "You are a helpful assistant that knows how to extract python code from images."}, {"role": "USER", "content": "Extract python code from the given image."}, {"role": "ASSISTANT", "content": "from datetime import datetime\r\n\r\nfrom sqlalchemy import ForeignKey\r\nfrom sqlalchemy.orm import Mapped, mapped_column, relationship\r\n\r\nfrom ..database import Base\r\n\r\n\r\nclass View(Base):\r\n __tablename__ = \"views\"\r\n\r\n id: Mapped[str] = mapped_column(primary_key=True)\r\n author_id: Mapped[str] = mapped_column(ForeignKey(\"users.id\"))\r\n post_id: Mapped[str] = mapped_column(ForeignKey(\"posts.id\"))\r\n view_date: Mapped[datetime] = mapped_column(default_factory=datetime.utcnow)\r\n\r\n author = relationship(\"User\", back_populates=\"views\")\r\n post = relationship(\"Post\", back_populates=\"views\")\r\n"}]}
135
+ {"file_name": "4d49e77c-734c-469a-9baf-83bbb60ee623.png", "messages": [{"role": "SYSTEM", "content": "You are a helpful assistant that knows how to extract python code from images."}, {"role": "USER", "content": "Extract python code from the given image."}, {"role": "ASSISTANT", "content": "def add(a, b):\r\n \"\"\"\r\n Add two numbers together.\r\n\r\n Parameters\r\n ----------\r\n a : int or float\r\n First number to be added.\r\n b : int or float\r\n Second number to be added.\r\n\r\n Returns\r\n -------\r\n int or float\r\n Sum of a and b.\r\n\r\n Raises\r\n ------\r\n TypeError\r\n If a or b is not an int or float.\r\n \"\"\"\r\n try:\r\n return operator.add(a, b)\r\n except TypeError:\r\n raise TypeError(\"a and b must be either int or float\")\r\n\r\n # Example 1: Adding two integers\r\n result = add(5, 10)\r\n print(result) # Output: 15\r\n\r\n # Example 2: Adding two floats\r\n result = add(3.5, 2.5)\r\n print(result) # Output: 6.0\r\n\r\n # Example 3: Adding an integer and a string\r\n result = add(5, \"10\")\r\n # Output: TypeError: a and b must be either int or float\r\n \r\n \r\n "}]}
136
+ {"file_name": "ccdaa8c9-81dc-498a-9046-721417fb0ed3.png", "messages": [{"role": "SYSTEM", "content": "You are a helpful assistant that knows how to extract python code from images."}, {"role": "USER", "content": "Extract python code from the given image."}, {"role": "ASSISTANT", "content": "import cv2\r\nfrom ultralytics import YOLO\r\n\r\n\r\n# model = YOLO(\"yolov9c.pt\")\r\n# model = YOLO(\"yolov8x.pt\")\r\nmodel = YOLO('yolov9c-seg.pt')\r\nres = model.predict(\"soccer.jpeg\", save=True)\r\nprint(res)"}]}
137
+ {"file_name": "b7cce6e2-e6d4-461f-888b-6373790d2fef.png", "messages": [{"role": "SYSTEM", "content": "You are a helpful assistant that knows how to extract python code from images."}, {"role": "USER", "content": "Extract python code from the given image."}, {"role": "ASSISTANT", "content": "from flask.cli import FlaskGroup\r\nfrom app import create_app\r\n\r\n\r\napp = create_app()\r\ncli = FlaskGroup(create_app=create_app)\r\n\r\n\r\nif __name__ == \"__main__\":\r\n cli()"}]}
138
+ {"file_name": "bd946ac6-ec8c-4eb7-8a99-35efb0124030.png", "messages": [{"role": "SYSTEM", "content": "You are a helpful assistant that knows how to extract python code from images."}, {"role": "USER", "content": "Extract python code from the given image."}, {"role": "ASSISTANT", "content": "from dotenv import load_dotenv\r\nload_dotenv()\r\nimport os\r\n\r\nimport googlemaps\r\ngmaps = googlemaps.Client(key=os.environ['GOOGLE_MAPS_API_KEY'])\r\n\r\n# directions_result = gmaps.directions(\r\n# start,\r\n# end,\r\n# waypoints=waypoints,\r\n# mode=transit_type,\r\n# units=\"metric\",\r\n# optimize_waypoints=True,\r\n# traffic_model=\"best_guess\",\r\n# departure_time=start_time,\r\n# )\r\ndef convert_to_coords(input_address):\r\n return gmaps.geocode(input_address)\r\n\r\ngmaps = googlemaps.Client(key=os.environ[\"GOOGLE_MAPS_API_KEY\"])\r\n\r\nexample_coords = convert_to_coords(\"Rachives, Nairobi Kenya\")\r\nprint(example_coords)"}]}
139
+ {"file_name": "b8540c6d-1e87-47fc-94ee-d7a88a1357f4.png", "messages": [{"role": "SYSTEM", "content": "You are a helpful assistant that knows how to extract python code from images."}, {"role": "USER", "content": "Extract python code from the given image."}, {"role": "ASSISTANT", "content": ""}]}
140
+ {"file_name": "06f15523-2eb9-4269-b9aa-b4399fe864a0.png", "messages": [{"role": "SYSTEM", "content": "You are a helpful assistant that knows how to extract python code from images."}, {"role": "USER", "content": "Extract python code from the given image."}, {"role": "ASSISTANT", "content": "from setuptools import find_packages, setup\r\nfrom pip._vendor import tomli\r\n\r\n# For consistent encoding\r\nfrom codecs import open\r\nfrom os import path\r\n\r\n# The directory containing this file\r\nHERE = path.abspath(path.dirname(__file__))\r\n\r\n# Get the long description from the README file\r\nwith open(path.join(HERE, 'README.md'), encoding='utf-8') as f:\r\n LONG_DESCRIPTION = f.read()\r\n\r\nwith open('pyproject.toml', 'r') as f:\r\n VERSION = tomli.load(f)['tool']['commitizen']['version']\r\n\r\nDESCRIPTION = 'A python library for working with Google Drive.'\r\n\r\nkey_words = [\r\n 'drive', 'google-drive', 'google-drive-api', 'upload files to Google Drive',\r\n]\r\n\r\ninstall_requires = [\r\n 'oryks-google-oauth',\r\n 'pydantic',\r\n 'pydantic-settings'\r\n]\r\n\r\nsetup(\r\n name='oryks-google-drive',\r\n packages=find_packages(\r\n include=[\r\n 'google_drive',\r\n 'google_drive.exceptions',\r\n 'google_drive.models',\r\n 'google_drive.schemas',\r\n 'google_drive.resources'\r\n ]\r\n ),"}]}
141
+ {"file_name": "f2826d96-90ea-4cfc-88a4-a583d653f6e1.png", "messages": [{"role": "SYSTEM", "content": "You are a helpful assistant that knows how to extract python code from images."}, {"role": "USER", "content": "Extract python code from the given image."}, {"role": "ASSISTANT", "content": "from google_drive import GoogleDrive\r\n\r\n\r\nclient_secrets_file = 'drive.json'\r\ndrive = GoogleDrive(client_secret_file=client_secrets_file)\r\ndrive.authenticate()\r\n"}]}
142
+ {"file_name": "1663d19f-2b5a-4417-9ec6-0484256f288a.png", "messages": [{"role": "SYSTEM", "content": "You are a helpful assistant that knows how to extract python code from images."}, {"role": "USER", "content": "Extract python code from the given image."}, {"role": "ASSISTANT", "content": "from dotenv import load_dotenv\r\nload_dotenv()\r\nfrom assistant.agents import default_agent\r\nimport chainlit as cl\r\n\r\n\r\n@cl.on_chat_start\r\nasync def start():\r\n cl.user_session.set('agent', default_agent)\r\n\r\n\r\n@cl.on_message\r\nasync def main(message: cl.Message):\r\n agent = cl.user_session.get('agent')\r\n msg = cl.Message(content='')\r\n await msg.send()\r\n await cl.sleep(1)\r\n msg.content = agent.invoke({'input': message.content})['output']\r\n await msg.update()\r\n"}]}
143
+ {"file_name": "f41c87d8-b0ea-4870-bd06-9af3c653e6de.png", "messages": [{"role": "SYSTEM", "content": "You are a helpful assistant that knows how to extract python code from images."}, {"role": "USER", "content": "Extract python code from the given image."}, {"role": "ASSISTANT", "content": "from setuptools import find_packages, setup\r\nfrom pip._vendor import tomli\r\n\r\n# For consistent encoding\r\nfrom codecs import open\r\nfrom os import path\r\n\r\n# The directory containing this file\r\nHERE = path.abspath(path.dirname(__file__))\r\n\r\n# Get the long description from the README file\r\nwith open(path.join(HERE, 'README.md'), encoding='utf-8') as f:\r\n LONG_DESCRIPTION = f.read()\r\n\r\nwith open('pyproject.toml', 'r') as f:\r\n VERSION = tomli.load(f)['tool']['commitizen']['version']\r\n\r\nDESCRIPTION = 'A chatbot that enables the user interact with youtube over chat.'\r\n\r\nkey_words = [\r\n 'youtube', 'youtube-api', 'youtube comments', 'youtube videos', 'chat with youtube',\r\n 'youtube channels', 'youtube comment thread', 'create youtube playlist'\r\n]\r\n\r\ninstall_requires = [\r\n 'oryks-youtube',\r\n 'pydantic',\r\n 'pydantic-settings'\r\n]\r\n\r\nsetup(\r\n name='youtube-assistant',\r\n packages=find_packages(\r\n include=[\r\n 'assistant',\r\n ]\r\n ),\r\n version=VERSION,\r\n description=DESCRIPTION,\r\n long_description_content_type='text/markdown',"}]}
144
+ {"file_name": "6732d021-02cf-4351-a5c6-7e8b10869ac4.png", "messages": [{"role": "SYSTEM", "content": "You are a helpful assistant that knows how to extract python code from images."}, {"role": "USER", "content": "Extract python code from the given image."}, {"role": "ASSISTANT", "content": "\r\n\r\n\r\n\r\n"}]}
145
+ {"file_name": "94a57345-7ff3-4eee-bdbe-24265d8ba41b.png", "messages": [{"role": "SYSTEM", "content": "You are a helpful assistant that knows how to extract python code from images."}, {"role": "USER", "content": "Extract python code from the given image."}, {"role": "ASSISTANT", "content": "from dotenv import load_dotenv\r\nload_dotenv()\r\nimport chainlit as cl\r\nfrom farm_agent.agents import agent\r\nfrom farm_agent.utils import load_model, evaluate_image\r\nfrom PIL import Image\r\nimport io\r\n\r\n\r\nuser_location: str = None\r\nuser_name: str = None\r\nwelcome_text: str = \"\"\"\r\nHello there. This is an application that helps farmers monitor the health level of their crops. \r\nStart by giving me your name and location, then upload an image of your crops. I will analyze it to \r\ndetermine the diasease or pest that affects it and then tell you how to deal with the pest or \r\ndisease and where to purchase pesticides or fungicides.\r\n\"\"\"\r\n\r\n@cl.on_chat_start\r\nasync def start():\r\n cl.user_session.set(\"agent\", agent)\r\n await cl.Message(content=welcome_text).send()\r\n user_name = await cl.AskUserMessage(content=\"What is your name?\", timeout=120).send()\r\n user_location = await cl.AskUserMessage(content=\"Where are you from?\", timeout=120).send()\r\n res = await cl.AskActionMessage(\r\n content=\"Would you like to determine if your crops are infected by a disease or by pests?\",\r\n actions=[\r\n cl.Action(name=\"Check for diseases\", value=\"diseases\", label=\"\u2705 Check for diseases\"),\r\n cl.Action(name=\"Check for Pests\", value=\"pests\", label=\"\u274c Check for Pests\")\r\n ]\r\n ).send()\r\n if res and res.get(\"value\") == \"diseases\":\r\n files = None\r\n # Wait for the user to upload a file\r\n while files == None:\r\n files = await cl.AskFileMessage(\r\n content=f\"{user_name['content']}, start by uploading an image of your crop.\", \r\n accept=[\"image/jpeg\", \"image/png\", \"image/jpg\"]\r\n ).send()\r\n # Decode the file"}]}
146
+ {"file_name": "4644dc7c-254e-454e-b80e-2c5196e29756.png", "messages": [{"role": "SYSTEM", "content": "You are a helpful assistant that knows how to extract python code from images."}, {"role": "USER", "content": "Extract python code from the given image."}, {"role": "ASSISTANT", "content": "from dotenv import load_dotenv\r\nload_dotenv()\r\nimport chainlit as cl\r\n\r\nfrom calendar_assistant.usecases.agent import agent_executor\r\n\r\n\r\n@cl.on_message\r\nasync def main(message: cl.Message):\r\n msg = cl.Message(content=\"\")\r\n await msg.send()\r\n await cl.sleep(1)\r\n msg.content = agent_executor.invoke({\"input\": message.content})['output']\r\n await msg.update()"}]}
147
+ {"file_name": "e90744fe-7903-4e1a-ac5a-9d20c33141ca.png", "messages": [{"role": "SYSTEM", "content": "You are a helpful assistant that knows how to extract python code from images."}, {"role": "USER", "content": "Extract python code from the given image."}, {"role": "ASSISTANT", "content": "from dotenv import load_dotenv\r\nload_dotenv()\r\nimport chainlit as cl\r\nfrom farm_agent.agents import agent\r\nfrom farm_agent.utils import load_model, evaluate_image\r\nfrom PIL import Image\r\nimport io\r\n\r\n\r\nuser_location: str = None\r\nuser_name: str = None\r\nwelcome_text: str = \"\"\"\r\nHello there. This is an application that helps farmers monitor the health level of their crops. \r\nStart by giving me your name and location, then upload an image of your crops. I will analyze it to \r\ndetermine the diasease or pest that affects it and then tell you how to deal with the pest or \r\ndisease and where to purchase pesticides or fungicides.\r\n\"\"\"\r\n\r\n@cl.on_chat_start\r\nasync def start():\r\n cl.user_session.set(\"agent\", agent)\r\n await cl.Message(content=welcome_text).send()\r\n user_name = await cl.AskUserMessage(content=\"What is your name?\", timeout=120).send()\r\n user_location = await cl.AskUserMessage(content=\"Where are you from?\", timeout=120).send()\r\n res = await cl.AskActionMessage(\r\n content=\"Would you like to determine if your crops are infected by a disease or by pests?\",\r\n actions=[\r\n cl.Action(name=\"Check for diseases\", value=\"diseases\", label=\"\u2705 Check for diseases\"),\r\n cl.Action(name=\"Check for Pests\", value=\"pests\", label=\"\u274c Check for Pests\")\r\n ]\r\n ).send()\r\n if res and res.get(\"value\") == \"diseases\":\r\n files = None\r\n # Wait for the user to upload a file\r\n while files == None:\r\n files = await cl.AskFileMessage(\r\n content=f\"{user_name['content']}, start by uploading an image of your crop.\", \r\n accept=[\"image/jpeg\", \"image/png\", \"image/jpg\"]\r\n ).send()\r\n # Decode the file"}]}
148
+ {"file_name": "671ef76a-7d26-431c-aa5c-cdf86a98ca3d.png", "messages": [{"role": "SYSTEM", "content": "You are a helpful assistant that knows how to extract python code from images."}, {"role": "USER", "content": "Extract python code from the given image."}, {"role": "ASSISTANT", "content": "import chainlit as cl\r\nfrom assistant.utils.assistant_utils import welcome_user\r\nfrom assistant.agent import get_agent_executor\r\n\r\n\r\n@cl.on_chat_start\r\nasync def start():\r\n res = await cl.AskUserMessage(content=\"What is your name?\", timeout=30).send()\r\n if res:\r\n msg = cl.Message(content=\"\")\r\n await msg.send()\r\n msg.content = welcome_user(user_name=res['content'])\r\n await msg.update()\r\n \r\n\r\n@cl.on_message\r\nasync def main(message: cl.Message):\r\n msg = cl.Message(content=\"\")\r\n await msg.send()\r\n query: str = message.content\r\n agent_executor = get_agent_executor(query)\r\n msg.content = agent_executor.invoke({\"input\": query})['output']\r\n await msg.update()"}]}
149
+ {"file_name": "f28cb5a0-9737-47f2-ba41-3e44e13e135c.png", "messages": [{"role": "SYSTEM", "content": "You are a helpful assistant that knows how to extract python code from images."}, {"role": "USER", "content": "Extract python code from the given image."}, {"role": "ASSISTANT", "content": "import torch\r\nimport os\r\nfrom torch import nn\r\nfrom torchvision import transforms\r\nimport numpy as np\r\nimport os\r\nfrom PIL import Image\r\nimport torch\r\nimport os\r\nfrom torch import nn\r\nimport torch.nn.functional as F\r\nimport random\r\n\r\n\r\nclass MaizeNet(nn.Module):\r\n def __init__(self, K) -> None:\r\n super(MaizeNet, self).__init__()\r\n\r\n self.conv_layers = nn.Sequential(\r\n # convolution 1\r\n nn.Conv2d(in_channels=3, out_channels=32, kernel_size=3, padding=1),\r\n nn.ReLU(),\r\n nn.BatchNorm2d(32),\r\n nn.Conv2d(in_channels=32, out_channels=32, kernel_size=3, padding=1),\r\n nn.ReLU(),\r\n nn.BatchNorm2d(32),\r\n nn.MaxPool2d(2),\r\n # Convolution 2\r\n nn.Conv2d(in_channels=32, out_channels=64, kernel_size=3, padding=1),\r\n nn.ReLU(),\r\n nn.BatchNorm2d(64),\r\n nn.Conv2d(in_channels=64, out_channels=64, kernel_size=3, padding=1),\r\n nn.ReLU(),\r\n nn.BatchNorm2d(64),\r\n nn.MaxPool2d(2),\r\n # Convolution 3\r\n nn.Conv2d(in_channels=64, out_channels=128, kernel_size=3, padding=1),\r\n nn.ReLU(),\r\n nn.BatchNorm2d(128),\r\n nn.Conv2d(in_channels=128, out_channels=128, kernel_size=3, padding=1),"}]}
150
+ {"file_name": "651e6fca-31d2-4e7d-bd07-8930ba48fb17.png", "messages": [{"role": "SYSTEM", "content": "You are a helpful assistant that knows how to extract python code from images."}, {"role": "USER", "content": "Extract python code from the given image."}, {"role": "ASSISTANT", "content": "from flask.cli import FlaskGroup\r\nfrom app import create_app\r\n\r\n\r\napp = create_app()\r\ncli = FlaskGroup(create_app=create_app)\r\n\r\n\r\nif __name__ == \"__main__\":\r\n cli()"}]}