Skip to content

Commit c895bc1

Browse files
committed
updates to types
1 parent 1d9b4de commit c895bc1

File tree

1 file changed

+19
-24
lines changed

1 file changed

+19
-24
lines changed

src/inferencesh/models/llm.py

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,31 +23,27 @@ class Message(BaseAppInput):
2323

2424
class ContextMessage(BaseAppInput):
2525
role: ContextMessageRole = Field(
26-
description="The role of the message",
26+
description="the role of the message. user, assistant, or system",
2727
)
2828
text: str = Field(
29-
description="The text content of the message"
29+
description="the text content of the message"
3030
)
3131
image: Optional[File] = Field(
32-
description="The image url of the message",
32+
description="the image file of the message",
3333
default=None
3434
)
3535

3636
class BaseLLMInput(BaseAppInput):
3737
"""Base class with common LLM fields."""
3838
system_prompt: str = Field(
39-
description="The system prompt to use for the model",
40-
default="You are a helpful assistant that can answer questions and help with tasks.",
39+
description="the system prompt to use for the model",
40+
default="you are a helpful assistant that can answer questions and help with tasks.",
4141
examples=[
42-
"You are a helpful assistant that can answer questions and help with tasks.",
43-
"You are a certified medical professional who can provide accurate health information.",
44-
"You are a certified financial advisor who can give sound investment guidance.",
45-
"You are a certified cybersecurity expert who can explain security best practices.",
46-
"You are a certified environmental scientist who can discuss climate and sustainability.",
42+
"you are a helpful assistant that can answer questions and help with tasks.",
4743
]
4844
)
4945
context: List[ContextMessage] = Field(
50-
description="The context to use for the model",
46+
description="the context to use for the model",
5147
default=[],
5248
examples=[
5349
[
@@ -57,12 +53,9 @@ class BaseLLMInput(BaseAppInput):
5753
]
5854
)
5955
text: str = Field(
60-
description="The user prompt to use for the model",
56+
description="the user prompt to use for the model",
6157
examples=[
62-
"What is the capital of France?",
63-
"What is the weather like today?",
64-
"Can you help me write a poem about spring?",
65-
"Explain quantum computing in simple terms"
58+
"write a haiku about artificial general intelligence"
6659
]
6760
)
6861
temperature: float = Field(default=0.7, ge=0.0, le=1.0)
@@ -72,21 +65,23 @@ class BaseLLMInput(BaseAppInput):
7265
class ImageCapabilityMixin(BaseModel):
7366
"""Mixin for models that support image inputs."""
7467
image: Optional[File] = Field(
75-
description="The image to use for the model",
76-
default=None
68+
description="the image to use for the model",
69+
default=None,
70+
content_type=["image/*"],
71+
max_size_mb=10
7772
)
7873

7974
class ReasoningCapabilityMixin(BaseModel):
8075
"""Mixin for models that support reasoning."""
8176
reasoning: bool = Field(
82-
description="Enable step-by-step reasoning",
77+
description="enable step-by-step reasoning",
8378
default=False
8479
)
8580

8681
class ToolsCapabilityMixin(BaseModel):
8782
"""Mixin for models that support tool/function calling."""
8883
tools: Optional[List[Dict[str, Any]]] = Field(
89-
description="Tool definitions for function calling",
84+
description="tool definitions for function calling",
9085
default=None
9186
)
9287

@@ -111,26 +106,26 @@ class LLMUsage(BaseAppOutput):
111106

112107
class BaseLLMOutput(BaseAppOutput):
113108
"""Base class for LLM outputs with common fields."""
114-
response: str = Field(description="The generated text response")
109+
response: str = Field(description="the generated text response")
115110

116111
class LLMUsageMixin(BaseModel):
117112
"""Mixin for models that provide token usage statistics."""
118113
usage: Optional[LLMUsage] = Field(
119-
description="Token usage statistics",
114+
description="token usage statistics",
120115
default=None
121116
)
122117

123118
class ReasoningMixin(BaseModel):
124119
"""Mixin for models that support reasoning."""
125120
reasoning: Optional[str] = Field(
126-
description="The reasoning output of the model",
121+
description="the reasoning output of the model",
127122
default=None
128123
)
129124

130125
class ToolCallsMixin(BaseModel):
131126
"""Mixin for models that support tool calls."""
132127
tool_calls: Optional[List[Dict[str, Any]]] = Field(
133-
description="Tool calls for function calling",
128+
description="tool calls for function calling",
134129
default=None
135130
)
136131

0 commit comments

Comments
 (0)