Suchinthana commited on
Commit
0c2f440
·
1 Parent(s): 36e6906

prompt update

Browse files
Files changed (1) hide show
  1. app.py +37 -3
app.py CHANGED
@@ -35,9 +35,43 @@ def process_openai_response(query):
35
  response = openai_client.chat.completions.create(
36
  model="gpt-4o-mini",
37
  messages=[
38
- {"role": "system", "content": "You are a skilled assistant answering geographical and historical questions..."},
39
- {"role": "user", "content": query}
40
- ],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  temperature=1,
42
  max_tokens=2048,
43
  top_p=1,
 
35
  response = openai_client.chat.completions.create(
36
  model="gpt-4o-mini",
37
  messages=[
38
+ {
39
+ "role": "system",
40
+ "content": [
41
+ {
42
+ "type": "text",
43
+ "text": "\"input\": \"\"\"You are a skilled assistant answering geographical and historical questions. For each question, generate a structured output in JSON format, based on city names without coordinates. The response should include:\
44
+ Answer: A concise response to the question.\
45
+ Feature Representation: A feature type based on city names (Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, GeometryCollection).\
46
+ Description: A prompt for a diffusion model describing the what should we draw regarding that.\
47
+ \
48
+ Handle the following cases:\
49
+ \
50
+ 1. **Single or Multiple Points**: Create a point or a list of points for multiple cities.\
51
+ 2. **LineString**: Create a line between two cities.\
52
+ 3. **Polygon**: Represent an area formed by three or more cities (closed). Example: Cities forming a triangle (A, B, C).\
53
+ 4. **MultiPoint, MultiLineString, MultiPolygon, GeometryCollection**: Use as needed based on the question.\
54
+ \
55
+ For example, if asked about cities forming a polygon, create a feature like this:\
56
+ \
57
+ Input: Mark an area with three cities.\
58
+ Output: {\"input\": \"Mark an area with three cities.\", \"output\": {\"answer\": \"The cities A, B, and C form a triangle.\", \"feature_representation\": {\"type\": \"Polygon\", \"cities\": [\"A\", \"B\", \"C\"], \"properties\": {\"description\": \"satelite image of a plantation, green fill, 4k, map, detailed, greenary, plants, vegitation, high contrast\"}}}}\
59
+ \
60
+ Ensure all responses are descriptive and relevant to city names only, without coordinates.\
61
+ \"}\"}"
62
+ }
63
+ ]
64
+ },
65
+ {
66
+ "role": "user",
67
+ "content": [
68
+ {
69
+ "type": "text",
70
+ "text": query
71
+ }
72
+ ]
73
+ }
74
+ ],
75
  temperature=1,
76
  max_tokens=2048,
77
  top_p=1,