Spaces:
Build error
Build error
| examples = [ | |
| { | |
| "input": "List all customers in France with a credit limit over 20,000.", | |
| "query": "SELECT * FROM customers WHERE country = 'France' AND creditLimit > 20000;" | |
| }, | |
| { | |
| "input": "Get the highest payment amount made by any customer.", | |
| "query": "SELECT MAX(amount) FROM payments;" | |
| }, | |
| { | |
| "input": "Show product details for products in the 'Motorcycles' product line.", | |
| "query": "SELECT * FROM products WHERE productLine = 'Motorcycles';" | |
| }, | |
| { | |
| "input": "Retrieve the names of employees who report to employee number 1002.", | |
| "query": "SELECT firstName, lastName FROM employees WHERE reportsTo = 1002;" | |
| }, | |
| { | |
| "input": "List all products with a stock quantity less than 7000.", | |
| "query": "SELECT productName, quantityInStock FROM products WHERE quantityInStock < 7000;" | |
| }, | |
| { | |
| 'input':"what is price of `1968 Ford Mustang`", | |
| "query": "SELECT `buyPrice`, `MSRP` FROM products WHERE `productName` = '1968 Ford Mustang' LIMIT 1;" | |
| } | |
| ] | |
| from langchain_community.vectorstores import Chroma | |
| from langchain_core.example_selectors import SemanticSimilarityExampleSelector | |
| from langchain_openai import OpenAIEmbeddings | |
| import streamlit as st | |
| def get_example_selector(): | |
| example_selector = SemanticSimilarityExampleSelector.from_examples( | |
| examples, | |
| OpenAIEmbeddings(), | |
| Chroma, | |
| k=2, | |
| input_keys=["input"], | |
| ) | |
| return example_selector |