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
Copy file name to clipboardExpand all lines: src/snowflake/snowpark/functions.py
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -12742,24 +12742,24 @@ def ai_complete(
12742
12742
... }
12743
12743
>>> df = session.range(1).select(
12744
12744
... ai_complete(
12745
-
... model='mistral-large2',
12745
+
... model='llama2-70b-chat',
12746
12746
... prompt='Analyze the sentiment of this text: I love this product!',
12747
12747
... response_format=response_schema
12748
12748
... ).alias("structured_result")
12749
12749
... )
12750
-
>>> result = df.collect()[0][0] # doctest: +SKIP
12751
-
>>> 'sentiment' in result and 'confidence' in result # doctest: +SKIP
12750
+
>>> result = df.collect()[0][0]
12751
+
>>> 'sentiment' in result and 'confidence' in result
12752
12752
True
12753
12753
12754
12754
>>> # Using prompt object from prompt() function
12755
12755
>>> df = session.range(1).select(
12756
12756
... ai_complete(
12757
-
... model='openai-gpt-4.1',
12757
+
... model='claude-3-7-sonnet',
12758
12758
... prompt=prompt("Extract the kitchen appliances identified in this image. Respond in JSON only with the identified appliances? {0}", to_file('@mystage/kitchen.png')),
12759
12759
... )
12760
12760
... )
12761
-
>>> result = df.collect()[0][0] # doctest: +SKIP
12762
-
>>> "microwave" in result and "refrigerator" in result # doctest: +SKIP
12761
+
>>> result = df.collect()[0][0]
12762
+
>>> "microwave" in result and "refrigerator" in result
0 commit comments