Skip to content

Commit

Permalink
Add more candidates in gemini few shot examples
Browse files Browse the repository at this point in the history
  • Loading branch information
eleurent committed Sep 8, 2024
1 parent 91e2bac commit 1ff6623
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions backend/nature_go/identification/gemini.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
from django.db.models import Q

CONFIGURED = False
PROMPT_PREFIX = """Identify the species in the picture, taking metadata into account.
PROMPT_PREFIX = """Identify the species in the picture, taking metadata into account. Be comprehensive.
Use this JSON schema:
Result = {"commonName": str, "scientificName": str, "confidence": float}
Expand All @@ -24,8 +25,10 @@
},
'url': 'https://preview.redd.it/whats-this-bird-v0-sx6m25i5pm0d1.jpeg?width=1080&crop=smart&auto=webp&s=004ec0c9d413ca38001a069172b4e35f729aabec',
'response': [
{"commonName": "Common starling", "scientificName": "Sturnus vulgaris", "confidence": 0.60},
{"commonName": "Spotless starling", "scientificName": "Sturnus unicolor", "confidence": 0.40}
{"commonName": "Common starling", "scientificName": "Sturnus vulgaris", "confidence": 0.70},
{"commonName": "Spotless starling", "scientificName": "Sturnus unicolor", "confidence": 0.10},
{"commonName": "Eurasian jackdaw", "scientificName": "Coloeus monedula", "confidence": 0.05},
{"commonName": "Common Grackle", "scientificName": "Quiscalus quiscula", "confidence": 0.01},
],
},
{
Expand All @@ -37,7 +40,8 @@
'response': [
{"commonName": "Hooded crow", "scientificName": "Corvus cornix", "confidence": 0.9},
{"commonName": "Carrion crow", "scientificName": "Corvus corone", "confidence": 0.1},
{"commonName": "Eurasian jay", "scientificName": "Garrulus glandarius", "confidence": 0.05}
{"commonName": "Eurasian jackdaw", "scientificName": "Coloeus monedula", "confidence": 0.05},
{"commonName": "Eurasian jay", "scientificName": "Garrulus glandarius", "confidence": 0.02},
],
}
]
Expand Down

0 comments on commit 1ff6623

Please sign in to comment.