Skip to content

Commit

Permalink
0.1.9: fix: query or note
Browse files Browse the repository at this point in the history
  • Loading branch information
louis030195 committed Jan 2, 2023
1 parent c6bd845 commit da21179
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
18 changes: 10 additions & 8 deletions api.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,6 @@ def semantic_search(input: Input, _: Settings = Depends(get_settings)):
"""
Search for a given query in the corpus
"""
posthog.capture(
input.namespace,
"search",
{
"namespace": input.namespace,
"query_length": len(input.query),
},
)
# either note or query is present in the request
if not input.note and not input.query:
return JSONResponse(
Expand All @@ -322,6 +314,16 @@ def semantic_search(input: Input, _: Settings = Depends(get_settings)):
input.note.note_tags,
input.note.note_content,
)
posthog.capture(
input.namespace,
"search",
{
"namespace": input.namespace,
"query_length": len(query),
},
)


top_k = min(input.top_k, 5) # TODO might fail if index empty?

# TODO: handle too large query (chunk -> average)
Expand Down
4 changes: 2 additions & 2 deletions service.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ spec:
successThreshold: 1
failureThreshold: 60

image: gcr.io/obsidian-ai/obsidian-search:0.1.8
image: gcr.io/obsidian-ai/obsidian-search:0.1.9
env:
- name: SENTRY_RELEASE
value: "0.1.8"
value: "0.1.9"
- name: ENVIRONMENT
value: "production"
ports:
Expand Down

0 comments on commit da21179

Please sign in to comment.