Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Semantic Router
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
aurelio-labs
Semantic Router
Commits
414f41bf
Commit
414f41bf
authored
3 months ago
by
James Briggs
Browse files
Options
Downloads
Patches
Plain Diff
chore: lint
parent
4788c614
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
semantic_router/index/pinecone.py
+8
-3
8 additions, 3 deletions
semantic_router/index/pinecone.py
tests/unit/test_sync.py
+2
-2
2 additions, 2 deletions
tests/unit/test_sync.py
with
10 additions
and
5 deletions
semantic_router/index/pinecone.py
+
8
−
3
View file @
414f41bf
...
...
@@ -534,7 +534,9 @@ class PineconeIndex(BaseIndex):
scope
=
scope
,
)
async
def
_async_read_config
(
self
,
field
:
str
,
scope
:
str
|
None
=
None
)
->
ConfigParameter
:
async
def
_async_read_config
(
self
,
field
:
str
,
scope
:
str
|
None
=
None
)
->
ConfigParameter
:
"""
Read a config parameter from the index asynchronously.
:param field: The field to read.
...
...
@@ -566,7 +568,9 @@ class PineconeIndex(BaseIndex):
scope
=
scope
,
)
except
KeyError
:
raise
ValueError
(
f
"
Found invalid config record during sync:
{
config_record
}
"
)
raise
ValueError
(
f
"
Found invalid config record during sync:
{
config_record
}
"
)
else
:
logger
.
warning
(
f
"
Configuration for
{
field
}
parameter not found in index.
"
)
return
ConfigParameter
(
...
...
@@ -752,7 +756,8 @@ class PineconeIndex(BaseIndex):
"
namespace
"
:
namespace
,
}
async
with
self
.
async_client
.
post
(
f
"
https://
{
self
.
host
}
/vectors/delete
"
,
json
=
params
,
f
"
https://
{
self
.
host
}
/vectors/delete
"
,
json
=
params
,
)
as
response
:
return
await
response
.
json
(
content_type
=
None
)
...
...
This diff is collapsed.
Click to expand it.
tests/unit/test_sync.py
+
2
−
2
View file @
414f41bf
...
...
@@ -154,7 +154,7 @@ def cohere_encoder(mocker):
# Handle either docs or utterances parameter
texts
=
docs
if
docs
is
not
None
else
utterances
return
mock_encoder_call
(
texts
)
mocker
.
patch
.
object
(
CohereEncoder
,
"
acall
"
,
side_effect
=
async_mock_encoder_call
)
return
CohereEncoder
(
name
=
"
test-cohere-encoder
"
,
cohere_api_key
=
"
test_api_key
"
)
...
...
@@ -168,7 +168,7 @@ def openai_encoder(mocker):
# Handle either docs or utterances parameter
texts
=
docs
if
docs
is
not
None
else
utterances
return
mock_encoder_call
(
texts
)
mocker
.
patch
.
object
(
OpenAIEncoder
,
"
acall
"
,
side_effect
=
async_mock_encoder_call
)
return
OpenAIEncoder
(
name
=
"
text-embedding-3-small
"
,
openai_api_key
=
"
test_api_key
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment