Access high quality data without changing your workflows
Hassle-free integration of proprietary data sources into your ML workflows using our SDK tools.
Seamlessly interact with the Valyu platform through our intuitive dataset loader.
Easily import and utilise datasets directly within your workflows and notebooks.
Our tools integrate smoothly without disrupting your existing frameworks.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from valyu import Context, ChatMistralAI, PromptTemplate
llm = ChatMistralAI(model="mistral-large-latest")
context = Context(
data_sources=["UCL Times", "The London Times"],
credit_budget=120
)
prompt = PromptTemplate("""
You are a helpful AI assistant...
{context}
Question: {question}
Answer: """)
response = prompt.enrich_and_invoke(
context=context,
prompt="I'm a student in London, what are the top 2 news story headlines for today I should know about?",
llm=llm)
$ python3 sdk_demo.py
> Answer: 1. UCL ranked university of the year! ... 2. London to become the new SF ...
> Context: metadata=[
{
"page_context": "UCL has been awarded the University...",
"attribution": "UCL Times"
"source": "https://ucltimes/announcementa/uh7ns3n",
"start_index": 0,
"end_index": 49,
"influence": 0.54
}
]