import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
const response = await client.applications.process({
edges: [{ from_field: 'from_field', from_node: 'from_node', to_field: 'to_field', to_node: 'to_node' }],
inputs: { foo: { foo: 'bar' } },
nodes: [{ id: 'id', application_node_schema_id: 'text_input_schema' }],
version: 'V0',
});
console.log(response);{
"errors": [
{
"error_code": "INVALID_APPLICATION_NO_INPUT_NODE",
"message": "<string>"
}
],
"sgp_error_code": "APPLICATION_BUILDER_VALIDATION_ERROR"
}import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
const response = await client.applications.process({
edges: [{ from_field: 'from_field', from_node: 'from_node', to_field: 'to_field', to_node: 'to_node' }],
inputs: { foo: { foo: 'bar' } },
nodes: [{ id: 'id', application_node_schema_id: 'text_input_schema' }],
version: 'V0',
});
console.log(response);{
"errors": [
{
"error_code": "INVALID_APPLICATION_NO_INPUT_NODE",
"message": "<string>"
}
],
"sgp_error_code": "APPLICATION_BUILDER_VALIDATION_ERROR"
}List of nodes in the application graph
Show child attributes
text_input_schema, text_output_schema, knowledge_base_input_schema, knowledge_base_schema, multi_knowledge_base_input_schema, multi_knowledge_base_schema, reranker_schema, prompt_engineering_schema, completion_model_input_schema, completion_model_schema, external_endpoint_schema, document_input_schema, map_reduce_schema, document_search_schema, document_prompt_schema Version of the application schema
"V0"Optional overrides for the application
Show child attributes
Show child attributes
Control to have streaming of the endpoint. If the last node before the output is a completion node, you can set this to true to get the output as soon as the completion node has a token
Arbitrary user-defined metadata that can be attached to the process operations and will be registered in the interaction.
Successful Response