You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
messages=[{'role': 'user', 'content': 'I have two friends. The first is Ollama 22 years old busy saving the world, and the second is Alonso 23 years old and wants to hang out. Return a list of friends in JSON format'}],
22
+
format=FriendList.model_json_schema(), # Use Pydantic to generate the schema
23
+
options={'temperature': 0}, # Make responses more deterministic
raiseFileNotFoundError(f'Image not found at: {path}')
32
+
33
+
# Set up chat as usual
34
+
response=chat(
35
+
model='llama3.2-vision',
36
+
format=ImageDescription.model_json_schema(), # Pass in the schema for the response
37
+
messages=[
38
+
{
39
+
'role': 'user',
40
+
'content': 'Analyze this image and return a detailed JSON description including objects, scene, colors and any text detected. If you cannot determine certain details, leave those fields empty.',
41
+
'images': [path],
42
+
},
43
+
],
44
+
options={'temperature': 0}, # Set temperature to 0 for more deterministic output
messages=[{'role': 'user', 'content': 'I have two friends. The first is Ollama 22 years old busy saving the world, and the second is Alonso 23 years old and wants to hang out. Return a list of friends in JSON format'}],
20
+
format=FriendList.model_json_schema(), # Use Pydantic to generate the schema or format=schema
21
+
options={'temperature': 0}, # Make responses more deterministic
0 commit comments