44 lines
873 B
Python
44 lines
873 B
Python
|
|
|
|
from langchain_ollama import ChatOllama
|
|
|
|
LLM = ChatOllama(model='qwen2.5:14b', base_url='insert base url here')
|
|
|
|
tavily_key = ''
|
|
|
|
gaode_key = ''
|
|
|
|
#
|
|
#
|
|
# import requests
|
|
#
|
|
# url = 'http://192.168.195.158:61000/LLMProcessStream'
|
|
# json = {
|
|
# "conversation_id": "49fcf90889cb5538d6171cc5043537cd",
|
|
# "model": "qwen2.5:14b",
|
|
# "user_input": "Good day",
|
|
# "require_voice": False,
|
|
# "rag": False
|
|
# }
|
|
#
|
|
# headers = {'Authorization': '9a504ac370734c811d107b2f634185b0', 'user': "armor"}
|
|
# response = requests.post(url, json=json, headers=headers, stream=True)
|
|
#
|
|
# result_str = ''
|
|
# flag = True
|
|
# for i in response:
|
|
# target = i.decode('utf-8')
|
|
# if '<1json2>' not in target:
|
|
# pass
|
|
# else:
|
|
# flag = False
|
|
# if flag:
|
|
# print(target, end='')
|
|
# if not flag:
|
|
# result_str += target
|
|
# result_str = result_str.replace('<1json2>', '')
|
|
# print('')
|
|
# print(result_str)
|
|
|
|
|