Use knowledge bank in API Designer
rafael_rosado97
Partner, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 62 Partner
Hello, Dataiku Team
I am trying to deploy an endpoint to API node where I can use knowledge bank object from my project flow.
I am using this code example but when I write this line:
vector_store = kb.as_langchain_vectorstore()
I get the next error:
Failed:
Failed to run function : <class 'requests.exceptions.InvalidSchema'> : No connection adapters were found for '127.0.0.1:61068/dip/api/tintercom/knowledge-bank/get'
Even, I tried to use dataikuapi but the same:
import dataiku
import dataikuapi
from langchain.chains.question_answering import load_qa_chain
from dataiku.langchain.dku_llm import DKUChatLLM
def starting_chatbot(user_query):
KB_ID = "my_kb_key" # Fill with your KB id
GPT_LLM_ID = "my_llm_id" # Fill with your LLM-Mesh id
host = 'my_host'
apiKey = 'my_key'
client = dataikuapi.DSSClient(host, apiKey)
project = client.get_project("PROJECT_NAME")
kb = project.get_knowledge_bank(id=KB_ID)
kb_core = kb.as_core_knowledge_bank()
lc_vs = kb_core.as_langchain_retriever()
Do you know why it happens?
Thank you!
Operating system used: Ubuntu
Operating system used: Ubuntu
Tagged: