# Copyright 2024 Soul Machines Ltd

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

#     http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# generated by datamodel-codegen:
#   filename:  common.yml
#   timestamp: 2024-04-02T22:17:10+00:00

from __future__ import annotations

from enum import Enum
from typing import Any, Optional

from pydantic import BaseModel, Field


class Intent(BaseModel):
    name: Optional[str] = Field(
        default=None,
        description=(
            "Name of intent that handled the request or 'NO_MATCH' if a fallback is hit"
        ),
    )
    confidence: Optional[float] = Field(
        default=None, description="Confidence of the intent matched in the range 0-1"
    )


class MemoryScope(Enum):
    PRIVATE = "PRIVATE"
    PUBLIC = "PUBLIC"


class Memory(BaseModel):
    name: str = Field(..., description="Identifier for the memory value")
    value: Any = Field(..., description="Memory value (can be of any type)")
    session_id: Optional[str] = Field(
        default=None, description="Optional session ID to identify this memory value"
    )
    scope: Optional[MemoryScope] = None


class DeploymentEnvironment(Enum):
    preview = "preview"
    public = "public"
