collection_id | embedding | document | cmetadata | custom_id | uuid |
---|---|---|---|---|---|
ff110448-5113-4a9d-9c92-ba44d49db00c | [embedding vector] | Apakah Kredivo tersedia di seluruh kota di Indonesia? | {"category": "Cara Mendaftar"} | b08b598e-5c6c-4c72-8bf4-c1338aab2904 | 701c6ae0-8065-4344-b222-2de5223d0a5b |
ff110448-5113-4a9d-9c92-ba44d49db00c | [embedding vector] | Apa saja syarat pengajuan Kredivo? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Search for similar documents | |
query = 'bagaimana cara ganti pin?' | |
similar_docs = search_similar_documents(vector_store, query) | |
# Print results | |
for doc in similar_docs: | |
print(f'Similar document: {doc.page_content}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
title | name | |
---|---|---|
Apakah Kredivo tersedia di seluruh kota di Indonesia? | Cara Mendaftar | |
Apa saja syarat pengajuan Kredivo? | Cara Mendaftar | |
Dokumen apa saja yang diperlukan untuk membuat dan memiliki akun Kredivo? | Cara Mendaftar | |
Bagaimana cara mengaktivasi akun Kredivo saya? | Cara Aktivasi | |
Apakah ada batas waktu untuk aktivasi akun Kredivo saya? | Cara Aktivasi | |
Mengapa saya tidak dapat memasukkan PIN saat aktivasi akun atau muncul keterangan error pada halaman pengaturan PIN? | Cara Aktivasi | |
Saya ingin belanja secara kredit tanpa kartu kredit. Apakah saya bisa melakukannya dengan Kredivo? | Tipe Akun | |
Apa perbedaan akun Starter, Basic dan Premium? | Tipe Akun | |
Apa itu akun Starter dan fasilitas apa yang didapatkan? | Tipe Akun |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data_string = '''cats, animal | |
dogs, animal | |
lions, animal | |
elephants, animal | |
penguins, animal | |
dolphins, animal | |
pandas, animal | |
tigers, animal | |
horses, animal | |
koalas, animal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sample documents | |
sample_docs = load_documents_from_csv('sample_kredivo_faq.csv') | |
# Create vector store | |
vector_store = create_pgvector_store(sample_docs, collection_name='sample_kredivo_faq') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from typing import List | |
from dotenv import load_dotenv | |
from langchain_openai import OpenAIEmbeddings | |
from langchain_community.vectorstores.pgvector import DistanceStrategy | |
from langchain_community.vectorstores import PGVector | |
from langchain.docstore.document import Document | |
load_dotenv(override=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
import time | |
import signal | |
import logging | |
class GracefulKiller: | |
def __init__(self): | |
self.kill_now = False | |
signal.signal(signal.SIGINT, self.exit_gracefully) | |
signal.signal(signal.SIGTERM, self.exit_gracefully) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo docker ps | |
>>> CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
>>> 776c6e63c95c producer_consumer_consumer "/usr/bin/dumb-init …" 15 seconds ago Up 14 seconds consumer | |
>>> 09c11d829ace producer_consumer_producer "/usr/bin/dumb-init …" 15 seconds ago Up 13 seconds 0.0.0.0:8000->8000/tcp producer | |
>>> 79f87828de3f wurstmeister/zookeeper "/bin/sh -c '/usr/sb…" 16 minutes ago Up 16 minutes 22/tcp, 2888/tcp, 3888/tcp, 0.0.0.0:2182->2181/tcp zookeeper | |
>>> 2e3b815047ed wurstmeister/kafka "start-kafka.sh" 16 minutes ago Up 16 minutes 0.0.0.0:9092->9092/tcp kafka |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo docker ps | |
>>> CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
>>> 79f87828de3f wurstmeister/zookeeper "/bin/sh -c '/usr/sb…" 42 seconds ago Up 38 seconds 22/tcp, 2888/tcp, 3888/tcp, 0.0.0.0:2182->2181/tcp zookeeper | |
>>> 2e3b815047ed wurstmeister/kafka "start-kafka.sh" 42 seconds ago Up 39 seconds 0.0.0.0:9092->9092/tcp kafka |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo docker network create tutorial | |
>>> a9487a8f771f607b4fe59f9e57580f5771a25fe6c606345844dee72ed8b12975 | |
sudo docker network ls | |
>>> NETWORK ID NAME DRIVER SCOPE | |
>>> a9487a8f771f tutorial bridge local | |
sudo docker network inspect tutorial | |
>>> [ | |
>>> { |
NewerOlder