Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ai
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
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
project
ai
Commits
062a8df1
Commit
062a8df1
authored
4 months ago
by
Scott Euser
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3477735
by scott_euser: Switch to Json::decode() from Drupal core
parent
c1f62e77
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!114
Json::decode()
Pipeline
#296919
passed
4 months ago
Stage: build
Stage: validate
Stage: test
Stage: .post
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/vdb_providers/vdb_provider_milvus/src/MilvusV2.php
+8
-7
8 additions, 7 deletions
modules/vdb_providers/vdb_provider_milvus/src/MilvusV2.php
with
8 additions
and
7 deletions
modules/vdb_providers/vdb_provider_milvus/src/MilvusV2.php
+
8
−
7
View file @
062a8df1
...
...
@@ -2,6 +2,7 @@
namespace
Drupal\vdb_provider_milvus
;
use
Drupal\Component\Serialization\Json
;
use
GuzzleHttp\Client
;
/**
...
...
@@ -102,7 +103,7 @@ class MilvusV2 {
$options
[
'schema'
][
'autoID'
]
=
TRUE
;
$options
[
'schema'
][
'enableDynamicField'
]
=
FALSE
;
return
j
son
_
decode
(
$this
->
makeRequest
(
'vectordb/collections/create'
,
[],
'POST'
,
$options
)
,
TRUE
);
return
J
son
::
decode
(
$this
->
makeRequest
(
'vectordb/collections/create'
,
[],
'POST'
,
$options
));
}
/**
...
...
@@ -123,7 +124,7 @@ class MilvusV2 {
if
(
$database_name
&&
!
$this
->
isZilliz
())
{
$params
[
'dbName'
]
=
$database_name
;
}
return
j
son
_
decode
(
$this
->
makeRequest
(
'vectordb/collections/drop'
,
[],
'POST'
,
$params
)
,
TRUE
);
return
J
son
::
decode
(
$this
->
makeRequest
(
'vectordb/collections/drop'
,
[],
'POST'
,
$params
));
}
/**
...
...
@@ -138,7 +139,7 @@ class MilvusV2 {
public
function
listCollections
(
string
$database_name
=
''
):
array
{
// Has to be an object, when empty ¯\_(ツ)_/¯.
$data
=
$database_name
&&
!
$this
->
isZilliz
()
?
[
'dbName'
=>
$database_name
]
:
new
\stdClass
();
return
j
son
_
decode
(
$this
->
makeRequest
(
'vectordb/collections/list'
,
[],
'POST'
,
$data
)
,
TRUE
);
return
J
son
::
decode
(
$this
->
makeRequest
(
'vectordb/collections/list'
,
[],
'POST'
,
$data
));
}
/**
...
...
@@ -162,7 +163,7 @@ class MilvusV2 {
if
(
$database_name
&&
!
$this
->
isZilliz
())
{
$params
[
'dbName'
]
=
$database_name
;
}
return
j
son
_
decode
(
$this
->
makeRequest
(
'vectordb/entities/insert'
,
[],
'POST'
,
$params
)
,
TRUE
);
return
J
son
::
decode
(
$this
->
makeRequest
(
'vectordb/entities/insert'
,
[],
'POST'
,
$params
));
}
/**
...
...
@@ -186,7 +187,7 @@ class MilvusV2 {
if
(
$database_name
&&
!
$this
->
isZilliz
())
{
$params
[
'dbName'
]
=
$database_name
;
}
return
j
son
_
decode
(
$this
->
makeRequest
(
'vectordb/entities/delete'
,
[],
'POST'
,
$params
)
,
TRUE
);
return
J
son
::
decode
(
$this
->
makeRequest
(
'vectordb/entities/delete'
,
[],
'POST'
,
$params
));
}
/**
...
...
@@ -222,7 +223,7 @@ class MilvusV2 {
}
$response
=
$this
->
makeRequest
(
'vectordb/entities/query'
,
[],
'POST'
,
$params
);
return
j
son
_
decode
(
$response
,
TRUE
);
return
J
son
::
decode
(
$response
);
}
/**
...
...
@@ -262,7 +263,7 @@ class MilvusV2 {
}
$response
=
$this
->
makeRequest
(
'vectordb/entities/search'
,
[],
'POST'
,
$params
);
return
j
son
_
decode
(
$response
,
TRUE
);
return
J
son
::
decode
(
$response
);
}
/**
...
...
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