market_assistant/random_pick_crm_mandatory.py

25 lines
839 B
Python

from linguistic_checker import LinguisticChecker
import pandas as pd
api_key = '25bda2c39c0f8ca0'
api_secret = 'e0008b9b9727cb8ceea5a132dbe62495'
assistant_id = "66bb09a84673b57506fe7bbd"
checker = LinguisticChecker(api_key, api_secret, assistant_id)
df = pd.read_excel('./data_src/pingcap_pipeline.xlsx')
# Iterate over the DataFrame
for index, row in df.iterrows():
try:
# Assuming 'CRM Field' and 'User Input' are column names in the Excel file
# Adjust these names if they're different in your actual file
crm_field = row['CRM Field']
user_input = row['User Input']
# Check the input using the LinguisticChecker
result = checker.check_input(crm_field, user_input)
except Exception as e:
print(f"Error processing row {index}: {str(e)}")
result = None