Skip to content

Commit

Permalink
Merge pull request #294 from gitautoai/wes
Browse files Browse the repository at this point in the history
Isolate an instruction: Describe Image
  • Loading branch information
hiroshinishio authored Sep 5, 2024
2 parents b5f8cfb + 95cc466 commit ccb9505
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions services/openai/instructions/describe_image.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DESCRIBE_IMAGE = "Describe images found in my GitHub repositories. These images often include elements like text, shapes, arrows, red lines, and boxed areas, and may also contain screenshots of customer business services or SaaS interfaces. Extract and describe these elements, noting their positions and relationships, such as connections indicated by arrows or emphasis through red lines and boxes. Provide a comprehensive understanding of the visual and textual content."
2 changes: 0 additions & 2 deletions services/openai/instructions/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,3 @@
Once you have resolved the issue and committed the necessary changes, return "END" to indicate that the task is complete.
"""

USER_INSTRUCTION = "Describe images found in my GitHub repositories. These images often include elements like text, shapes, arrows, red lines, and boxed areas, and may also contain screenshots of customer business services or SaaS interfaces. Extract and describe these elements, noting their positions and relationships, such as connections indicated by arrows or emphasis through red lines and boxes. Provide a comprehensive understanding of the visual and textual content."
4 changes: 2 additions & 2 deletions services/openai/vision.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Local imports
from config import OPENAI_MODEL_ID, OPENAI_TEMPERATURE
from services.openai.init import create_openai_client
from services.openai.instructions.index import USER_INSTRUCTION
from services.openai.instructions.describe_image import DESCRIBE_IMAGE
from utils.handle_exceptions import handle_exceptions


Expand All @@ -24,7 +24,7 @@ def describe_image(base64_image: str) -> str:
"content": [
{
"type": "text",
"text": USER_INSTRUCTION,
"text": DESCRIBE_IMAGE,
},
{
"type": "image_url",
Expand Down

0 comments on commit ccb9505

Please sign in to comment.