Skip to content

Commit ea7b204

Browse files
Adjusted doc string - example AI abstractions (#32)
* Enhance memory extraction prompt with structured guidance and detailed field descriptions * Update Python string color to match Jac syntax highlighting * Enhance Jac syntax highlighting by updating Python string and comment colors
1 parent 38c600f commit ea7b204

File tree

2 files changed

+38
-3
lines changed

2 files changed

+38
-3
lines changed

jaseci-org/lib/data/verticalTabs.js

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ obj MemoryDetails {
1212
has where: str;
1313
}
1414
sem MemoryDetails = "Extract people, event, place, and time from a photo";
15+
sem MemoryDetails.who = "Names of people in the photo";
16+
sem MemoryDetails.what = "What is happening in the scene";
17+
sem MemoryDetails.where = "Location or setting of the photo";
1518
1619
def extract_memory_details(
1720
image: Image, city: str
@@ -78,6 +81,7 @@ with entry {
7881
{
7982
filename: "cloud_scaling.jac",
8083
code: `
84+
# walker automatically becomes an endpoint
8185
walker memories {
8286
has current_user: str = "";
8387
@@ -87,7 +91,10 @@ walker memories {
8791
f"Hello {self.current_user}, here are your memories!"
8892
};
8993
}
90-
}`,
94+
}
95+
# Auth & database handled by Jac-cloud behind the scenes
96+
# No boilerplate here
97+
`,
9198
},
9299
];
93100

@@ -116,7 +123,24 @@ tools = [{
116123
}
117124
}]
118125
119-
SYS_PROMPT = "Extract people, event, place, and time from the photo."
126+
SYS_PROMPT = """
127+
# Goal
128+
Extract structured memory details from the photo.
129+
130+
# Fields
131+
- who: list of people or animals involved
132+
- what: short description of the activity or event
133+
- where: location or place mentioned
134+
135+
# Rules
136+
- Only use details from the photo and user input
137+
- Do not hallucinate or invent missing information
138+
- Always return using the \`process_memory\` tool
139+
140+
# Guidance
141+
- If some fields are missing, leave them empty
142+
- Keep responses factual and concise
143+
"""
120144
121145
with open("image.png", "rb") as f:
122146
image_b64 = base64.b64encode(f.read()).decode("utf-8")
@@ -128,7 +152,8 @@ messages = [
128152
"content": [
129153
{"type": "text", "text": "Photo took in Paris."},
130154
{"type": "image_url", "image_url": {
131-
"url": f"data:image/png;base64,{image_b64}"
155+
"url": f"data:image/png;base64,{image_b64}"}
156+
}
132157
]
133158
}
134159
]
@@ -171,6 +196,7 @@ class Local:
171196
class Tourist:
172197
def __init__(self):
173198
self.visited = []
199+
174200
def start_trip(self, places):
175201
print("🚶 Begins the journey")
176202
for place in places:

jaseci-org/lib/syntax/jacSyntax.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ code.language-python.line-numbers .line-numbers-rows {
3636
display: none !important;
3737
}
3838

39+
/* Make Python strings and comments match Jac colors */
40+
.language-python .token.string {
41+
color: #ce9178 !important;
42+
}
43+
.language-python .token.comment {
44+
color: #6a9955 !important;
45+
font-style: italic !important;
46+
}
47+
3948
code[class*="language-"], .jac-code-block {
4049
font-size: 0.8rem !important;
4150
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;

0 commit comments

Comments
 (0)