Spaces:
Sleeping
Sleeping
| import requests | |
| from langchain_core.messages import SystemMessage,HumanMessage | |
| from ..utils.schemas import EmojiCountFormater | |
| from ..utils.prompts import emoji_count_prompt | |
| from ..utils.utils import process_query | |
| def get_emoji_count(state,llm_gpt , url): | |
| messages = [SystemMessage(content=emoji_count_prompt), | |
| HumanMessage(content=str(state['messages']))] | |
| parameters=llm_gpt.with_structured_output(EmojiCountFormater , method='function_calling').invoke(messages) | |
| print(parameters) | |
| response = requests.get(url, params={'top_n': parameters.top_n, 'influencer_username':process_query(parameters.influencer_name)}) | |
| print('The response is:', response) | |
| return response | |