continue-custom/server/continuedev/core/observation.py
Nate Sesti 279593a848
Strong typing (#533)
* refactor: ♻️ get rid of continuedev.src.continuedev structure

* refactor: ♻️ switching back to server folder

* feat: ✨ make config.py imports shorter

* feat: 🔖 publish as pre-release vscode extension

* refactor: ♻️ refactor and add more completion params to ui

* build: 🏗️ download from preview S3
2023-10-04 23:47:59 -07:00

41 lines
699 B
Python

from pydantic import BaseModel, validator
from ..models.main import Traceback
class Observation(BaseModel):
pass
class TracebackObservation(Observation):
traceback: Traceback
class ValidatorObservation(Observation):
passed: bool
class UserInputObservation(Observation):
user_input: str
class DictObservation(Observation):
values: dict
def __getitem__(self, key):
return self.values[key]
class TextObservation(Observation):
text: str
@validator("text", pre=True, always=True)
def text_not_none(cls, v):
if v is None:
return ""
return v
class InternalErrorObservation(Observation):
title: str
error: str