Skip to content

Silas new site search and SDK 1.0 release #1317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 72 commits into from
Feb 28, 2024
Merged
Changes from 1 commit
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
be03897
New site search
SilasMarvin Jan 10, 2024
9df3528
Working fast site search and vector search
SilasMarvin Jan 13, 2024
f9cb8a1
Cleaned tests and remote fallback working for search and vector_search
SilasMarvin Jan 17, 2024
b04ead6
Clean up vector search
SilasMarvin Jan 17, 2024
44ab0ed
Switched to a transactional version of upsert documents and syncing p…
SilasMarvin Jan 17, 2024
9aaa31b
Working conditional pipeline running on document upsert
SilasMarvin Jan 18, 2024
6979f69
Really good upsert documents
SilasMarvin Jan 18, 2024
c8e1af8
Cleaned up some tests
SilasMarvin Jan 18, 2024
9df12b5
Switching old pipeline to be a pass through for the new multi field p…
SilasMarvin Jan 19, 2024
f75a2ec
Finished pipeline as a pass through and more tests
SilasMarvin Jan 22, 2024
59f4419
Working site search with doc type filtering
SilasMarvin Jan 22, 2024
ec351ff
Working site search with doc type filtering
SilasMarvin Jan 23, 2024
027080f
collection query_builder now a wrapper around collection.vector_search
SilasMarvin Jan 23, 2024
44cc8a0
Verifying on Python and JavaScript
SilasMarvin Jan 24, 2024
6a9fd14
Working with JavaScript and Python
SilasMarvin Jan 25, 2024
099ea60
Cleaned up
SilasMarvin Jan 25, 2024
412fb57
Move MultiFieldPipeline to Pipeline and added batch uploads for docum…
SilasMarvin Jan 25, 2024
9781766
Added SingleFieldPipeline function shoutout to Lev
SilasMarvin Jan 25, 2024
b87a654
Working on fixing query
SilasMarvin Jan 27, 2024
17b81e7
Working recursive query
SilasMarvin Feb 5, 2024
7339cd5
Added smarter chunking and search results table
SilasMarvin Feb 5, 2024
84e621a
Updated deps, added debugger for queries
SilasMarvin Feb 9, 2024
d745fc6
Logging search results done
SilasMarvin Feb 9, 2024
2d75d98
Correct return type with search inserts
SilasMarvin Feb 9, 2024
bed7144
Updated tests to pass with new sqlx version
SilasMarvin Feb 9, 2024
0e06ce1
Added a way for users to provide search_events
SilasMarvin Feb 12, 2024
1677a51
Quick fix on remote embeddings search
SilasMarvin Feb 12, 2024
a5599e5
Quick fix and change the upsert query to be more efficient
SilasMarvin Feb 13, 2024
f47002e
Fix for JS after updating tokio
SilasMarvin Feb 13, 2024
f39b94c
Updated extractive_question_answering example for Python
SilasMarvin Feb 13, 2024
f2c5f61
Updated question_answering for Python
SilasMarvin Feb 13, 2024
6ec6df5
Updated question_answering_instructor for Python
SilasMarvin Feb 13, 2024
c9a24e6
Updated semantic_search for Python
SilasMarvin Feb 14, 2024
6c7f05a
Updated summarizing_question_answering for Python
SilasMarvin Feb 14, 2024
119807f
Updated table question answering for Python
SilasMarvin Feb 14, 2024
71d4915
Updated table question answering for Python
SilasMarvin Feb 14, 2024
6dfd0d7
Updated rag question answering for Python
SilasMarvin Feb 14, 2024
70f1ac0
Updated question_answering for JavaScript
SilasMarvin Feb 14, 2024
67fae04
Updated question_answering_instructor for JavaScript
SilasMarvin Feb 14, 2024
0dd0027
Updated question_answering_instructor for JavaScript
SilasMarvin Feb 14, 2024
7afea01
Updated extractive_question_answering example for JavaScript
SilasMarvin Feb 14, 2024
95188a4
Updated summarizing_question_answering for JavaScript
SilasMarvin Feb 14, 2024
8807489
Updated semantic_search for JavaScript
SilasMarvin Feb 14, 2024
c9e5d04
Updated versions and removed unused clone
SilasMarvin Feb 14, 2024
c71143f
Cleaned up search query
SilasMarvin Feb 14, 2024
f4d261e
Edit test
SilasMarvin Feb 14, 2024
3d1a6ce
Added the stress test
SilasMarvin Feb 14, 2024
692c252
Updated to use new sdk
SilasMarvin Feb 14, 2024
fc5658f
Updated test
SilasMarvin Feb 15, 2024
4c38aca
Removed document_id
SilasMarvin Feb 16, 2024
4167e32
Removed document_id and updated all searches to work without it
SilasMarvin Feb 16, 2024
0cadd8c
Fixed python test
SilasMarvin Feb 16, 2024
077ce1b
Updated stress test
SilasMarvin Feb 16, 2024
7f53b93
Updated to clean up pool access
SilasMarvin Feb 16, 2024
144da42
Added test for bad collection names
SilasMarvin Feb 16, 2024
039c9cc
Cleaned up tests
SilasMarvin Feb 16, 2024
bd983cf
Add migration error
SilasMarvin Feb 26, 2024
4fb0149
Updated text
SilasMarvin Feb 26, 2024
b4f1edd
Add dockerfile to build javascript
SilasMarvin Feb 26, 2024
c41597a
Working dockerfile for build
SilasMarvin Feb 26, 2024
3f53e9c
Test github docker build
SilasMarvin Feb 26, 2024
679b995
Iterating on gh action
SilasMarvin Feb 26, 2024
c614e4e
Iterating on gh action
SilasMarvin Feb 26, 2024
7169596
Iterating on gh action
SilasMarvin Feb 26, 2024
8de7727
Iterating on gh action
SilasMarvin Feb 26, 2024
25fe41c
Iterating on gh action
SilasMarvin Feb 26, 2024
271e1e4
Updated collection test
SilasMarvin Feb 26, 2024
9e4c2a1
Finished boosting and working with the new sdk
SilasMarvin Feb 27, 2024
c46957c
Made document search just use semantic search and boosted title
SilasMarvin Feb 27, 2024
0d963a8
Updated the chatbot to use the new chat history
SilasMarvin Feb 27, 2024
d9b241d
Small cleanups
SilasMarvin Feb 27, 2024
a34619b
Adjust boosting
SilasMarvin Feb 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated summarizing_question_answering for Python
  • Loading branch information
SilasMarvin committed Feb 28, 2024
commit 6c7f05ac931a2153e85c14e4ee3b3f32942b9d5d
24 changes: 15 additions & 9 deletions pgml-sdks/pgml/python/examples/summarizing_question_answering.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@ async def main():
# Initialize collection
collection = Collection("squad_collection")

# Create a pipeline using the default model and splitter
model = Model()
splitter = Splitter()
pipeline = Pipeline("squadv1", model, splitter)
# Create and add pipeline
pipeline = Pipeline(
"squadv1",
{
"text": {
"splitter": {"model": "recursive_character"},
"semantic_search": {"model": "intfloat/e5-small"},
}
},
)
await collection.add_pipeline(pipeline)

# Prep documents for upserting
Expand All @@ -32,21 +38,21 @@ async def main():
# Upsert documents
await collection.upsert_documents(documents[:200])

# Query for context
# Query for answer
query = "Who won more than 20 grammy awards?"
console.print("Querying for context ...")
start = time()
results = (
await collection.query().vector_recall(query, pipeline).limit(5).fetch_all()
results = await collection.vector_search(
{"query": {"fields": {"text": {"query": query}}}, "limit": 3}, pipeline
)
end = time()
console.print("\n Results for '%s' " % (query), style="bold")
console.print(results)
console.print("Query time = %0.3f" % (end - start))

# Construct context from results
context = " ".join(results[0][1].strip().split())
context = context.replace('"', '\\"').replace("'", "''")
chunks = [r["chunk"] for r in results]
context = "\n\n".join(chunks)

# Query for summary
builtins = Builtins()
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy