WilliamGazeley commited on
Commit
3291dfe
·
1 Parent(s): 5dd89d6

Order by date first and boost vec top k

Browse files
Files changed (1) hide show
  1. src/functions.py +2 -2
src/functions.py CHANGED
@@ -44,12 +44,12 @@ def get_analysis(query: str) -> dict:
44
  embed_model = "default-large-embeddings"
45
 
46
  vec = openai_client.embeddings.create(input=[query], model=embed_model).data[0].embedding
47
- vector_query = VectorizedQuery(vector=vec, k_nearest_neighbors=config.az_search_top_k * 2, fields="vector")
48
  results = az_search_client.search(
49
  search_text="*",
50
  vector_queries=[vector_query],
51
  select=["date", "popularity", "sequence", "context", "securities"],
52
- order_by=["securities desc", "date desc", "popularity desc"],
53
  top=config.az_search_top_k,
54
  )
55
 
 
44
  embed_model = "default-large-embeddings"
45
 
46
  vec = openai_client.embeddings.create(input=[query], model=embed_model).data[0].embedding
47
+ vector_query = VectorizedQuery(vector=vec, k_nearest_neighbors=100, fields="vector")
48
  results = az_search_client.search(
49
  search_text="*",
50
  vector_queries=[vector_query],
51
  select=["date", "popularity", "sequence", "context", "securities"],
52
+ order_by=["date desc", "securities desc", "popularity desc"],
53
  top=config.az_search_top_k,
54
  )
55