Knowledgator UTCA
KnowledgatorGitHubDiscord
  • Welcome to UTCA documentation!
  • Quickstart
  • Concepts
    • Components
    • Types of components
    • ExecutionSchema
    • Context
    • Scopes
  • Development and Contribution
    • Contribution
    • Future relises
  • Framework structure
  • Core
    • Component
    • BaseExecutor
    • Action
    • Executable
    • Evaluator
    • Memory management
    • Schemas
    • Exceptions
  • Structural components
    • ExecutionSchema
    • Switch
    • ForEach
    • Filter
    • While
    • Condition
    • BREAK
    • Log
  • Base Actions
    • Flush
    • AddData
    • RenameAttribute
    • RenameAttributeQuery
    • SetValue
    • UnpackValue
    • NestToKey
    • ExecuteFunction
  • Predictors
    • Predictor
    • Transformers predictors
    • Transformers schemas
    • TokenSearcherPredictor
    • ComprehendItPredictor
    • GLiNERPredictor
    • OpenAIChatGPTPredictor
    • OpenAIWhisperPredictor
  • Tasks
    • Task
    • ComprehendIt
    • TokenSearcherTextCleaner
    • TokenSearcherNER
    • TokenSearcherQandA
    • TokenSearcherRelationExtraction
    • GLiNER
    • GLiNERRelationExtraction
    • GLiNERQandA
    • OpenAIChat
    • WhisperSpeechToText
    • TransformersTextToSpeech
    • TransformersChartsAndPlotsAnalysis
    • TransformersDocumentQandA
    • TransformersImageClassification
    • TransformersVisualQandA
    • TransformersObjectDetection
    • TransformersTextEmbedding
    • TransformersEntityLinking
    • TransformersTokenClassifier
    • TransformersTextSummarization
    • TransformersTextualQandA
    • TransformersTextClassification
    • TransformersChat
    • Objects
    • Chat tasks utilities
    • Relation extraction tasks utilities
  • Executable Schemas
    • SemanticSearchSchema
    • Web2Meaning
    • RequestsHTML
  • Datasources
    • Audio
    • DB
      • SQL
      • Neo4j
      • Chroma
      • Qdrant
    • Google Documents
    • Google Sheets
    • Image
    • Index
    • JSON
    • PDF
    • Plain text
    • Video
  • Conditions
    • RePattern
    • SemanticCondition
  • APIs
    • GoogleCloudClient
  • Integrations
    • Google Cloud
  • Examples
    • Basic image classification
    • Text to speech
    • PDF document processing
Powered by GitBook
On this page
  1. Concepts

Scopes

PreviousContextNextDevelopment and Contribution

Last updated 1 year ago

The term "scope" describes how data is organized hierarchically. At the top level is the global scope, which encompasses the entire intermidiate data (i.e. state of ). Nested within this global scope are inner scopes, corresponding to the values associated with specific keys in the dictionary.

Example of a state, where dictionary value is a global scope, and the keys "prompt", "messages", "images", "search_results" are inner scopes:

{
    "prompt": "Some prompt value",
    "messages": ["message1", "message2"],
    "images": [{
        "image": PIL.Image
    }],
    "search_results": {
        "indexes": [1, 2],
        "scores": [0.9, 0.7]
    }
} 

All components manipulate the global scope of input data, which refers to the complete state of . Additionally, and have the capability to manipulate inner scopes using and , respectively. These executors are created upon the use method call and retain the context of execution, which includes the following parameters:

  • get_key (Optional[str], optional): Specifies which key value of input_data will be utilized (i.e., the scope to be used).

  • set_key (Optional[str], optional): Determines which key will be used to set the result value. If set_key is set to None:

    • if the result is of type Dict[str, Any], it updates the root dict.

    • otherwise, it sets the result to the default_key. (i.e., the scope where the data is placed)

  • default_key (str, optional): Denotes the default key used for results that are not of type Dict. If the data is not a Dict, a new default scope is created or used.

  • replace (, optional): Specifies the strategy for replacing data within the executor. It defines how and when data should be placed in the scope. Refer to description .

See more:

Action
Executable
Actions
Executables
Transformable
Transformable
Transformable
ReplacingScope
here
ActionExecutor
ExecutableExecutor