chat_protocol#

Attributes#

Classes#

AskQuestionResult

dict() -> new empty dictionary

HandleError

Base class for protocol classes.

ChatRequest

dict() -> new empty dictionary

ProjectChatProtocol

Base class for protocol classes.

Module Contents#

class chat_protocol.AskQuestionResult[source]#

Bases: TypedDict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

code: str | None[source]#
view_name: str | None[source]#
error: bool[source]#
message: str[source]#
class chat_protocol.HandleError[source]#

Bases: Protocol

Base class for protocol classes.

Protocol classes are defined as:

class Proto(Protocol):
    def meth(self) -> int:
        ...

Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing).

For example:

class C:
    def meth(self) -> int:
        return 0

def func(x: Proto) -> int:
    return x.meth()

func(C())  # Passes static type check

See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:

class GenProto[T](Protocol):
    def meth(self) -> T:
        ...
__call__(error: str | Exception, *, extra_metadata: dict | None = None) None[source]#
class chat_protocol.ChatRequest[source]#

Bases: TypedDict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

message: str[source]#
id: str[source]#
conversation_id: str[source]#
room: str[source]#
handle_error: HandleError[source]#
class chat_protocol.ProjectChatProtocol(project: mdvtools.mdvproject.MDVProject)[source]#

Bases: Protocol

Base class for protocol classes.

Protocol classes are defined as:

class Proto(Protocol):
    def meth(self) -> int:
        ...

Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing).

For example:

class C:
    def meth(self) -> int:
        return 0

def func(x: Proto) -> int:
    return x.meth()

func(C())  # Passes static type check

See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:

class GenProto[T](Protocol):
    def meth(self) -> T:
        ...
log(msg: str, *args: Any) None[source]#
get_suggested_questions() list[str][source]#
ask_question(chat_request: ChatRequest) AskQuestionResult[source]#
welcome: str[source]#
init_error: bool | None[source]#
error_message: str | None[source]#
chat_protocol.chat_enabled = True[source]#
chat_protocol.msg = ''[source]#
chat_protocol.ProjectChat: type[ProjectChatProtocol][source]#