File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change 1+ import snowflake .connector # type: ignore
2+
13from contextual import ContextualAI
2- import snowflake .connector
3- import requests
4- import base64
5- import json
64
75SF_BASE_URL = 'xxxxx-xxxxx-xxxxx.snowflakecomputing.app'
86BASE_URL = f'https://{ SF_BASE_URL } /v1'
97
108SAMPLE_MESSAGE = 'Can you tell me about XYZ'
119
12- ctx = snowflake .connector .connect (
10+ ctx = snowflake .connector .connect ( # type: ignore
1311 user = "" ,# snowflake account user
1412 password = '' , # snowflake account password
1513 account = "organization-account" , # snowflake organization and account <Organization>-<Account>
1816 })
1917
2018# Obtain a session token.
21- token_data = ctx ._rest ._token_request ('ISSUE' )
22- token_extract = token_data ['data' ]['sessionToken' ]
19+ token_data = ctx ._rest ._token_request ('ISSUE' ) # type: ignore
20+ token_extract = token_data ['data' ]['sessionToken' ] # type: ignore
2321
2422# Create a request to the ingress endpoint with authz.
2523api_key = f'\" { token_extract } \" '
4240 }
4341]
4442
45- res = client .agents .query .create (agent .id , messages = messages )
43+ res = client .agents .query .create (agent .id , messages = messages ) # type: ignore
4644
47- output = res .message .content
45+ output = res .message .content # type: ignore
4846
4947print (output )
You can’t perform that action at this time.
0 commit comments