langtree.prompting¶
Submodules¶
Package Contents¶
Classes¶
dict() -> new empty dictionary |
|
A generic chat message with attributes role and content. |
|
A system message with predefined role as "system" and an attribute content. |
|
An assistant message with predefined role as "assistant" and an attribute content. |
|
A user message with predefined role as "user" and an attribute content. |
|
A function message with attributes role, content, and name. |
- class langtree.prompting.Data(*args, **kwargs)[source]¶
Bases:
dictdict() -> 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)
- class langtree.prompting.ChatMessage(role=None, content=None)[source]¶
Bases:
langtree.utils.data.DataA generic chat message with attributes role and content.
- role¶
- content¶
- class langtree.prompting.SystemMessage(content=None)[source]¶
Bases:
ChatMessageA system message with predefined role as “system” and an attribute content.
- role = 'system'¶
- content¶
- class langtree.prompting.AssistantMessage(content=None)[source]¶
Bases:
ChatMessageAn assistant message with predefined role as “assistant” and an attribute content.
- role = 'assistant'¶
- content¶
- class langtree.prompting.UserMessage(content=None)[source]¶
Bases:
ChatMessageA user message with predefined role as “user” and an attribute content.
- role = 'user'¶
- content¶
- class langtree.prompting.FunctionMessage(content=None)[source]¶
Bases:
ChatMessageA function message with attributes role, content, and name. The role is predefined as “function”.
- role = 'function'¶
- name¶