Python
import os
from scale_gp import SGPClient
client = SGPClient(
api_key=os.environ.get("SGP_API_KEY"), # This is the default and can be omitted
)
artifact = client.knowledge_bases.artifacts.update(
artifact_id="artifact_id",
knowledge_base_id="knowledge_base_id",
)
print(artifact.knowledge_base_id)package main
import (
"context"
"fmt"
"github.com/stainless-sdks/sgp-go"
"github.com/stainless-sdks/sgp-go/option"
)
func main() {
client := sgp.NewClient(
option.WithAPIKey("My API Key"),
)
artifact, err := client.KnowledgeBases.Artifacts.Update(
context.TODO(),
"knowledge_base_id",
"artifact_id",
sgp.KnowledgeBaseArtifactUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", artifact.KnowledgeBaseID)
}
curl --request PATCH \
--url https://api.egp.scale.com/v4/knowledge-bases/{knowledge_base_id}/artifacts/{artifact_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{
"tags": {}
}'const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({tags: {}})
};
fetch('https://api.egp.scale.com/v4/knowledge-bases/{knowledge_base_id}/artifacts/{artifact_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.egp.scale.com/v4/knowledge-bases/{knowledge_base_id}/artifacts/{artifact_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'tags' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.patch("https://api.egp.scale.com/v4/knowledge-bases/{knowledge_base_id}/artifacts/{artifact_id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tags\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v4/knowledge-bases/{knowledge_base_id}/artifacts/{artifact_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tags\": {}\n}"
response = http.request(request)
puts response.read_body{
"knowledge_base_id": "<string>",
"artifact_name": "<string>",
"artifact_uri": "<string>",
"source": "S3",
"status": "Pending",
"created_at": "<string>",
"updated_at": "<string>",
"artifact_id": "<string>",
"chunking_strategy_config": {
"strategy": "character",
"separator": "\n\n",
"chunk_size": 1000,
"chunk_overlap": 200
},
"artifact_uri_public": "<string>",
"content_modification_identifier": "<string>",
"status_reason": "<string>",
"checkpoint": "Pending",
"deleted_at": "<string>",
"tags": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Knowledge Bases
Patch Artifact Information
PATCH
/
v4
/
knowledge-bases
/
{knowledge_base_id}
/
artifacts
/
{artifact_id}
Python
import os
from scale_gp import SGPClient
client = SGPClient(
api_key=os.environ.get("SGP_API_KEY"), # This is the default and can be omitted
)
artifact = client.knowledge_bases.artifacts.update(
artifact_id="artifact_id",
knowledge_base_id="knowledge_base_id",
)
print(artifact.knowledge_base_id)package main
import (
"context"
"fmt"
"github.com/stainless-sdks/sgp-go"
"github.com/stainless-sdks/sgp-go/option"
)
func main() {
client := sgp.NewClient(
option.WithAPIKey("My API Key"),
)
artifact, err := client.KnowledgeBases.Artifacts.Update(
context.TODO(),
"knowledge_base_id",
"artifact_id",
sgp.KnowledgeBaseArtifactUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", artifact.KnowledgeBaseID)
}
curl --request PATCH \
--url https://api.egp.scale.com/v4/knowledge-bases/{knowledge_base_id}/artifacts/{artifact_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{
"tags": {}
}'const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({tags: {}})
};
fetch('https://api.egp.scale.com/v4/knowledge-bases/{knowledge_base_id}/artifacts/{artifact_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.egp.scale.com/v4/knowledge-bases/{knowledge_base_id}/artifacts/{artifact_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'tags' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.patch("https://api.egp.scale.com/v4/knowledge-bases/{knowledge_base_id}/artifacts/{artifact_id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tags\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v4/knowledge-bases/{knowledge_base_id}/artifacts/{artifact_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tags\": {}\n}"
response = http.request(request)
puts response.read_body{
"knowledge_base_id": "<string>",
"artifact_name": "<string>",
"artifact_uri": "<string>",
"source": "S3",
"status": "Pending",
"created_at": "<string>",
"updated_at": "<string>",
"artifact_id": "<string>",
"chunking_strategy_config": {
"strategy": "character",
"separator": "\n\n",
"chunk_size": 1000,
"chunk_overlap": 200
},
"artifact_uri_public": "<string>",
"content_modification_identifier": "<string>",
"status_reason": "<string>",
"checkpoint": "Pending",
"deleted_at": "<string>",
"tags": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Headers
Body
application/json
Tags to associate with the artifact. Will overwrite existing tags.
Response
Successful Response
Available options:
S3, SharePoint, SharePointPage, LocalFile, LocalChunks, GoogleDrive, AzureBlobStorage, GoogleCloudStorage, Confluence, Slack, Snowflake, Databricks, SQLDatabase, MongoDB, BigQuery Available options:
Pending, Chunking, Uploading, Completed, Failed, Deleting, Canceled, Embedding - CharacterChunkingStrategyConfig
- TokenChunkingStrategyConfig
- CustomChunkingStrategyConfig
- PreChunkedStrategyConfig
- EnhancedChunkingStrategyConfig
Show child attributes
Show child attributes
Available options:
Pending, Chunking, Uploading, Completed, Failed, Deleting, Canceled, Embedding 
