airtrain 0.1.43__tar.gz → 0.1.44__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. {airtrain-0.1.43 → airtrain-0.1.44}/PKG-INFO +2 -2
  2. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/__init__.py +1 -1
  3. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/anthropic/__init__.py +10 -0
  4. airtrain-0.1.44/airtrain/integrations/anthropic/list_models.py +110 -0
  5. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/anthropic/skills.py +1 -1
  6. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/aws/skills.py +1 -1
  7. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/cerebras/skills.py +1 -1
  8. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/fireworks/completion_skills.py +1 -1
  9. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/fireworks/conversation_manager.py +1 -1
  10. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/fireworks/requests_skills.py +1 -1
  11. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/fireworks/skills.py +1 -1
  12. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/fireworks/structured_completion_skills.py +1 -1
  13. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/fireworks/structured_requests_skills.py +1 -1
  14. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/fireworks/structured_skills.py +1 -1
  15. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/groq/skills.py +1 -1
  16. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/ollama/skills.py +1 -1
  17. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/openai/__init__.py +12 -0
  18. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/openai/chinese_assistant.py +1 -1
  19. airtrain-0.1.44/airtrain/integrations/openai/list_models.py +112 -0
  20. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/openai/skills.py +1 -1
  21. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/together/models_config.py +2 -2
  22. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain.egg-info/PKG-INFO +2 -2
  23. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain.egg-info/SOURCES.txt +2 -0
  24. {airtrain-0.1.43 → airtrain-0.1.44}/pyproject.toml +1 -1
  25. {airtrain-0.1.43 → airtrain-0.1.44}/MANIFEST.in +0 -0
  26. {airtrain-0.1.43 → airtrain-0.1.44}/README.md +0 -0
  27. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/__main__.py +0 -0
  28. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/builder/__init__.py +0 -0
  29. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/builder/agent_builder.py +0 -0
  30. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/cli/__init__.py +0 -0
  31. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/cli/builder.py +0 -0
  32. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/cli/main.py +0 -0
  33. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/contrib/__init__.py +0 -0
  34. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/contrib/travel/__init__.py +0 -0
  35. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/contrib/travel/agents.py +0 -0
  36. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/contrib/travel/models.py +0 -0
  37. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/core/__init__.py +0 -0
  38. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/core/credentials.py +0 -0
  39. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/core/schemas.py +0 -0
  40. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/core/skills.py +0 -0
  41. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/__init__.py +0 -0
  42. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/anthropic/credentials.py +0 -0
  43. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/anthropic/models_config.py +0 -0
  44. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/aws/__init__.py +0 -0
  45. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/aws/credentials.py +0 -0
  46. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/cerebras/__init__.py +0 -0
  47. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/cerebras/credentials.py +0 -0
  48. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/fireworks/__init__.py +0 -0
  49. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/fireworks/credentials.py +0 -0
  50. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/fireworks/list_models.py +0 -0
  51. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/fireworks/models.py +0 -0
  52. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/google/__init__.py +0 -0
  53. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/google/credentials.py +0 -0
  54. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/google/skills.py +0 -0
  55. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/groq/__init__.py +0 -0
  56. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/groq/credentials.py +0 -0
  57. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/ollama/__init__.py +0 -0
  58. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/ollama/credentials.py +0 -0
  59. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/openai/credentials.py +0 -0
  60. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/openai/models_config.py +0 -0
  61. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/sambanova/__init__.py +0 -0
  62. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/sambanova/credentials.py +0 -0
  63. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/sambanova/skills.py +0 -0
  64. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/together/__init__.py +0 -0
  65. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/together/audio_models_config.py +0 -0
  66. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/together/credentials.py +0 -0
  67. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/together/embedding_models_config.py +0 -0
  68. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/together/image_models_config.py +0 -0
  69. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/together/image_skill.py +0 -0
  70. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/together/list_models.py +0 -0
  71. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/together/models.py +0 -0
  72. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/together/rerank_models_config.py +0 -0
  73. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/together/rerank_skill.py +0 -0
  74. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/together/schemas.py +0 -0
  75. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/together/skills.py +0 -0
  76. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain/integrations/together/vision_models_config.py +0 -0
  77. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain.egg-info/dependency_links.txt +0 -0
  78. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain.egg-info/entry_points.txt +0 -0
  79. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain.egg-info/requires.txt +0 -0
  80. {airtrain-0.1.43 → airtrain-0.1.44}/airtrain.egg-info/top_level.txt +0 -0
  81. {airtrain-0.1.43 → airtrain-0.1.44}/changelog.md +0 -0
  82. {airtrain-0.1.43 → airtrain-0.1.44}/requirements.txt +0 -0
  83. {airtrain-0.1.43 → airtrain-0.1.44}/setup.cfg +0 -0
  84. {airtrain-0.1.43 → airtrain-0.1.44}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: airtrain
3
- Version: 0.1.43
3
+ Version: 0.1.44
4
4
  Summary: A platform for building and deploying AI agents with structured skills
5
5
  Home-page: https://github.com/rosaboyle/airtrain.dev
6
6
  Author: Dheeraj Pai
@@ -1,6 +1,6 @@
1
1
  """Airtrain - A platform for building and deploying AI agents with structured skills"""
2
2
 
3
- __version__ = "0.1.43"
3
+ __version__ = "0.1.44"
4
4
 
5
5
  # Core imports
6
6
  from .core.skills import Skill, ProcessingError
@@ -9,6 +9,12 @@ from .models_config import (
9
9
  get_default_model,
10
10
  calculate_cost,
11
11
  )
12
+ from .list_models import (
13
+ AnthropicListModelsSkill,
14
+ AnthropicListModelsInput,
15
+ AnthropicListModelsOutput,
16
+ AnthropicModel,
17
+ )
12
18
 
13
19
  __all__ = [
14
20
  "AnthropicCredentials",
@@ -20,4 +26,8 @@ __all__ = [
20
26
  "get_model_config",
21
27
  "get_default_model",
22
28
  "calculate_cost",
29
+ "AnthropicListModelsSkill",
30
+ "AnthropicListModelsInput",
31
+ "AnthropicListModelsOutput",
32
+ "AnthropicModel",
23
33
  ]
@@ -0,0 +1,110 @@
1
+ from typing import Optional, List, Dict, Any
2
+ from pydantic import Field
3
+
4
+ from airtrain.core.skills import Skill, ProcessingError
5
+ from airtrain.core.schemas import InputSchema, OutputSchema
6
+ from .credentials import AnthropicCredentials
7
+ from .models_config import ANTHROPIC_MODELS, AnthropicModelConfig
8
+
9
+
10
+ class AnthropicModel:
11
+ """Class to represent an Anthropic model."""
12
+
13
+ def __init__(self, model_id: str, config: AnthropicModelConfig):
14
+ """Initialize the Anthropic model."""
15
+ self.id = model_id
16
+ self.display_name = config.display_name
17
+ self.base_model = config.base_model
18
+ self.input_price = config.input_price
19
+ self.cached_write_price = config.cached_write_price
20
+ self.cached_read_price = config.cached_read_price
21
+ self.output_price = config.output_price
22
+
23
+ def dict(self, exclude_none=False):
24
+ """Convert the model to a dictionary."""
25
+ result = {
26
+ "id": self.id,
27
+ "display_name": self.display_name,
28
+ "base_model": self.base_model,
29
+ "input_price": float(self.input_price),
30
+ "output_price": float(self.output_price),
31
+ }
32
+
33
+ if self.cached_write_price is not None:
34
+ result["cached_write_price"] = float(self.cached_write_price)
35
+ elif not exclude_none:
36
+ result["cached_write_price"] = None
37
+
38
+ if self.cached_read_price is not None:
39
+ result["cached_read_price"] = float(self.cached_read_price)
40
+ elif not exclude_none:
41
+ result["cached_read_price"] = None
42
+
43
+ return result
44
+
45
+
46
+ class AnthropicListModelsInput(InputSchema):
47
+ """Schema for Anthropic list models input"""
48
+
49
+ api_models_only: bool = Field(
50
+ default=False,
51
+ description=(
52
+ "If True, fetch models from the API only. If False, use local config."
53
+ )
54
+ )
55
+
56
+
57
+ class AnthropicListModelsOutput(OutputSchema):
58
+ """Schema for Anthropic list models output"""
59
+
60
+ models: List[Dict[str, Any]] = Field(
61
+ default_factory=list,
62
+ description="List of Anthropic models"
63
+ )
64
+
65
+
66
+ class AnthropicListModelsSkill(
67
+ Skill[AnthropicListModelsInput, AnthropicListModelsOutput]
68
+ ):
69
+ """Skill for listing Anthropic models"""
70
+
71
+ input_schema = AnthropicListModelsInput
72
+ output_schema = AnthropicListModelsOutput
73
+
74
+ def __init__(self, credentials: Optional[AnthropicCredentials] = None):
75
+ """Initialize the skill with optional credentials"""
76
+ super().__init__()
77
+ self.credentials = credentials
78
+
79
+ def process(
80
+ self, input_data: AnthropicListModelsInput
81
+ ) -> AnthropicListModelsOutput:
82
+ """Process the input and return a list of models."""
83
+ try:
84
+ models = []
85
+
86
+ if input_data.api_models_only:
87
+ # Fetch models from Anthropic API
88
+ # Require credentials if using API models
89
+ if not self.credentials:
90
+ raise ProcessingError(
91
+ "Anthropic credentials required for API models"
92
+ )
93
+
94
+ # Note: Anthropic doesn't have a public models list endpoint
95
+ # We'll raise an error instead
96
+ raise ProcessingError(
97
+ "Anthropic API does not provide a models list endpoint. "
98
+ "Use api_models_only=False to list models from local config."
99
+ )
100
+ else:
101
+ # Use local model config - no credentials needed
102
+ for model_id, config in ANTHROPIC_MODELS.items():
103
+ model = AnthropicModel(model_id, config)
104
+ models.append(model.dict())
105
+
106
+ # Return the output
107
+ return AnthropicListModelsOutput(models=models)
108
+
109
+ except Exception as e:
110
+ raise ProcessingError(f"Failed to list Anthropic models: {str(e)}")
@@ -26,7 +26,7 @@ class AnthropicInput(InputSchema):
26
26
  default="claude-3-opus-20240229", description="Anthropic model to use"
27
27
  )
28
28
  max_tokens: Optional[int] = Field(
29
- default=1024, description="Maximum tokens in response"
29
+ default=131072, description="Maximum tokens in response"
30
30
  )
31
31
  temperature: float = Field(
32
32
  default=0.7, description="Temperature for response generation", ge=0, le=1
@@ -21,7 +21,7 @@ class AWSBedrockInput(InputSchema):
21
21
  default="anthropic.claude-3-sonnet-20240229-v1:0",
22
22
  description="AWS Bedrock model to use",
23
23
  )
24
- max_tokens: int = Field(default=1024, description="Maximum tokens in response")
24
+ max_tokens: int = Field(default=131072, description="Maximum tokens in response")
25
25
  temperature: float = Field(
26
26
  default=0.7, description="Temperature for response generation", ge=0, le=1
27
27
  )
@@ -22,7 +22,7 @@ class CerebrasInput(InputSchema):
22
22
  )
23
23
  model: str = Field(default="llama3.1-8b", description="Cerebras model to use")
24
24
  max_tokens: Optional[int] = Field(
25
- default=1024, description="Maximum tokens in response"
25
+ default=131072, description="Maximum tokens in response"
26
26
  )
27
27
  temperature: float = Field(
28
28
  default=0.7, description="Temperature for response generation", ge=0, le=1
@@ -17,7 +17,7 @@ class FireworksCompletionInput(InputSchema):
17
17
  default="accounts/fireworks/models/deepseek-r1",
18
18
  description="Fireworks AI model to use",
19
19
  )
20
- max_tokens: int = Field(default=4096, description="Maximum tokens in response")
20
+ max_tokens: int = Field(default=131072, description="Maximum tokens in response")
21
21
  temperature: float = Field(
22
22
  default=0.7, description="Temperature for response generation", ge=0, le=1
23
23
  )
@@ -20,7 +20,7 @@ class ConversationState(BaseModel):
20
20
  description="Model being used for the conversation",
21
21
  )
22
22
  temperature: float = Field(default=0.7, description="Temperature setting")
23
- max_tokens: Optional[int] = Field(default=None, description="Max tokens setting")
23
+ max_tokens: Optional[int] = Field(default=131072, description="Max tokens setting")
24
24
 
25
25
 
26
26
  class FireworksConversationManager:
@@ -29,7 +29,7 @@ class FireworksRequestInput(InputSchema):
29
29
  temperature: float = Field(
30
30
  default=0.7, description="Temperature for response generation", ge=0, le=1
31
31
  )
32
- max_tokens: int = Field(default=4096, description="Maximum tokens in response")
32
+ max_tokens: int = Field(default=131072, description="Maximum tokens in response")
33
33
  top_p: float = Field(
34
34
  default=1.0, description="Top p sampling parameter", ge=0, le=1
35
35
  )
@@ -27,7 +27,7 @@ class FireworksInput(InputSchema):
27
27
  default=0.7, description="Temperature for response generation", ge=0, le=1
28
28
  )
29
29
  max_tokens: Optional[int] = Field(
30
- default=None, description="Maximum tokens in response"
30
+ default=131072, description="Maximum tokens in response"
31
31
  )
32
32
  context_length_exceeded_behavior: str = Field(
33
33
  default="truncate", description="Behavior when context length is exceeded"
@@ -21,7 +21,7 @@ class FireworksStructuredCompletionInput(InputSchema):
21
21
  temperature: float = Field(
22
22
  default=0.7, description="Temperature for response generation", ge=0, le=1
23
23
  )
24
- max_tokens: int = Field(default=4096, description="Maximum tokens in response")
24
+ max_tokens: int = Field(default=131072, description="Maximum tokens in response")
25
25
  response_model: Type[ResponseT]
26
26
  stream: bool = Field(
27
27
  default=False,
@@ -31,7 +31,7 @@ class FireworksStructuredRequestInput(InputSchema):
31
31
  temperature: float = Field(
32
32
  default=0.7, description="Temperature for response generation", ge=0, le=1
33
33
  )
34
- max_tokens: int = Field(default=4096, description="Maximum tokens in response")
34
+ max_tokens: int = Field(default=131072, description="Maximum tokens in response")
35
35
  response_model: Type[ResponseT]
36
36
  stream: bool = Field(
37
37
  default=False, description="Whether to stream the response token by token"
@@ -17,7 +17,7 @@ class FireworksParserInput(InputSchema):
17
17
  system_prompt: str = "You are a helpful assistant that provides structured data."
18
18
  model: str = "accounts/fireworks/models/deepseek-r1"
19
19
  temperature: float = 0.7
20
- max_tokens: Optional[int] = None
20
+ max_tokens: Optional[int] = 131072
21
21
  response_model: Type[ResponseT]
22
22
  conversation_history: List[Dict[str, str]] = Field(
23
23
  default_factory=list,
@@ -21,7 +21,7 @@ class GroqInput(InputSchema):
21
21
  model: str = Field(
22
22
  default="deepseek-r1-distill-llama-70b-specdec", description="Groq model to use"
23
23
  )
24
- max_tokens: int = Field(default=1024, description="Maximum tokens in response")
24
+ max_tokens: int = Field(default=131072, description="Maximum tokens in response")
25
25
  temperature: float = Field(
26
26
  default=0.7, description="Temperature for response generation", ge=0, le=1
27
27
  )
@@ -14,7 +14,7 @@ class OllamaInput(InputSchema):
14
14
  description="System prompt to guide the model's behavior",
15
15
  )
16
16
  model: str = Field(default="llama2", description="Ollama model to use")
17
- max_tokens: int = Field(default=1024, description="Maximum tokens in response")
17
+ max_tokens: int = Field(default=131072, description="Maximum tokens in response")
18
18
  temperature: float = Field(
19
19
  default=0.7, description="Temperature for response generation", ge=0, le=1
20
20
  )
@@ -1,3 +1,5 @@
1
+ """OpenAI API integration."""
2
+
1
3
  from .skills import (
2
4
  OpenAIChatSkill,
3
5
  OpenAIInput,
@@ -10,6 +12,12 @@ from .skills import (
10
12
  OpenAIEmbeddingsOutput,
11
13
  )
12
14
  from .credentials import OpenAICredentials
15
+ from .list_models import (
16
+ OpenAIListModelsSkill,
17
+ OpenAIListModelsInput,
18
+ OpenAIListModelsOutput,
19
+ OpenAIModel,
20
+ )
13
21
 
14
22
  __all__ = [
15
23
  "OpenAIChatSkill",
@@ -22,4 +30,8 @@ __all__ = [
22
30
  "OpenAIEmbeddingsSkill",
23
31
  "OpenAIEmbeddingsInput",
24
32
  "OpenAIEmbeddingsOutput",
33
+ "OpenAIListModelsSkill",
34
+ "OpenAIListModelsInput",
35
+ "OpenAIListModelsOutput",
36
+ "OpenAIModel",
25
37
  ]
@@ -17,7 +17,7 @@ class ChineseAssistantInput(OpenAIInput):
17
17
  description="System prompt in Chinese",
18
18
  )
19
19
  model: str = Field(default="gpt-4o", description="OpenAI model to use")
20
- max_tokens: int = Field(default=8096, description="Maximum tokens in response")
20
+ max_tokens: int = Field(default=131072, description="Maximum tokens in response")
21
21
  temperature: float = Field(
22
22
  default=0.7, description="Temperature for response generation", ge=0, le=1
23
23
  )
@@ -0,0 +1,112 @@
1
+ from typing import Optional, List, Dict, Any
2
+ from pydantic import Field
3
+
4
+ from airtrain.core.skills import Skill, ProcessingError
5
+ from airtrain.core.schemas import InputSchema, OutputSchema
6
+ from .credentials import OpenAICredentials
7
+ from .models_config import OPENAI_MODELS, OpenAIModelConfig
8
+
9
+
10
+ class OpenAIModel:
11
+ """Class to represent an OpenAI model."""
12
+
13
+ def __init__(self, model_id: str, config: OpenAIModelConfig):
14
+ """Initialize the OpenAI model."""
15
+ self.id = model_id
16
+ self.display_name = config.display_name
17
+ self.base_model = config.base_model
18
+ self.input_price = config.input_price
19
+ self.cached_input_price = config.cached_input_price
20
+ self.output_price = config.output_price
21
+
22
+ def dict(self, exclude_none=False):
23
+ """Convert the model to a dictionary."""
24
+ result = {
25
+ "id": self.id,
26
+ "display_name": self.display_name,
27
+ "base_model": self.base_model,
28
+ "input_price": float(self.input_price),
29
+ "output_price": float(self.output_price),
30
+ }
31
+ if self.cached_input_price is not None:
32
+ result["cached_input_price"] = float(self.cached_input_price)
33
+ elif not exclude_none:
34
+ result["cached_input_price"] = None
35
+ return result
36
+
37
+
38
+ class OpenAIListModelsInput(InputSchema):
39
+ """Schema for OpenAI list models input"""
40
+
41
+ api_models_only: bool = Field(
42
+ default=False,
43
+ description=(
44
+ "If True, fetch models from the API only. If False, use local config."
45
+ )
46
+ )
47
+
48
+
49
+ class OpenAIListModelsOutput(OutputSchema):
50
+ """Schema for OpenAI list models output"""
51
+
52
+ models: List[Dict[str, Any]] = Field(
53
+ default_factory=list,
54
+ description="List of OpenAI models"
55
+ )
56
+
57
+
58
+ class OpenAIListModelsSkill(Skill[OpenAIListModelsInput, OpenAIListModelsOutput]):
59
+ """Skill for listing OpenAI models"""
60
+
61
+ input_schema = OpenAIListModelsInput
62
+ output_schema = OpenAIListModelsOutput
63
+
64
+ def __init__(self, credentials: Optional[OpenAICredentials] = None):
65
+ """Initialize the skill with optional credentials"""
66
+ super().__init__()
67
+ self.credentials = credentials
68
+
69
+ def process(
70
+ self, input_data: OpenAIListModelsInput
71
+ ) -> OpenAIListModelsOutput:
72
+ """Process the input and return a list of models."""
73
+ try:
74
+ models = []
75
+
76
+ if input_data.api_models_only:
77
+ # Fetch models from OpenAI API - requires credentials
78
+ if not self.credentials:
79
+ raise ProcessingError(
80
+ "OpenAI credentials required for API models"
81
+ )
82
+
83
+ from openai import OpenAI
84
+ client = OpenAI(
85
+ api_key=self.credentials.openai_api_key.get_secret_value(),
86
+ organization=self.credentials.openai_organization_id,
87
+ )
88
+
89
+ # Make API call to get models
90
+ response = client.models.list()
91
+
92
+ # Convert response to our format
93
+ for model in response.data:
94
+ models.append({
95
+ "id": model.id,
96
+ "display_name": model.id, # API doesn't provide display_name
97
+ "base_model": model.id, # API doesn't provide base_model
98
+ "created": model.created,
99
+ "owned_by": model.owned_by,
100
+ # Pricing info not available from API
101
+ })
102
+ else:
103
+ # Use local model config - no credentials needed
104
+ for model_id, config in OPENAI_MODELS.items():
105
+ model = OpenAIModel(model_id, config)
106
+ models.append(model.dict())
107
+
108
+ # Return the output
109
+ return OpenAIListModelsOutput(models=models)
110
+
111
+ except Exception as e:
112
+ raise ProcessingError(f"Failed to list OpenAI models: {str(e)}")
@@ -29,7 +29,7 @@ class OpenAIInput(InputSchema):
29
29
  default=0.7, description="Temperature for response generation", ge=0, le=1
30
30
  )
31
31
  max_tokens: Optional[int] = Field(
32
- default=None, description="Maximum tokens in response"
32
+ default=131072, description="Maximum tokens in response"
33
33
  )
34
34
  stream: bool = Field(
35
35
  default=False,
@@ -13,7 +13,7 @@ TOGETHER_MODELS: Dict[str, ModelConfig] = {
13
13
  "deepseek-ai/DeepSeek-R1": ModelConfig(
14
14
  organization="DeepSeek",
15
15
  display_name="DeepSeek-R1",
16
- context_length=32768,
16
+ context_length=131072,
17
17
  quantization="FP8",
18
18
  ),
19
19
  "deepseek-ai/DeepSeek-R1-Distill-Llama-70B": ModelConfig(
@@ -37,7 +37,7 @@ TOGETHER_MODELS: Dict[str, ModelConfig] = {
37
37
  "deepseek-ai/DeepSeek-V3": ModelConfig(
38
38
  organization="DeepSeek",
39
39
  display_name="DeepSeek-V3",
40
- context_length=16384,
40
+ context_length=131072,
41
41
  quantization="FP8",
42
42
  ),
43
43
  # Meta Models
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: airtrain
3
- Version: 0.1.43
3
+ Version: 0.1.44
4
4
  Summary: A platform for building and deploying AI agents with structured skills
5
5
  Home-page: https://github.com/rosaboyle/airtrain.dev
6
6
  Author: Dheeraj Pai
@@ -28,6 +28,7 @@ airtrain/core/skills.py
28
28
  airtrain/integrations/__init__.py
29
29
  airtrain/integrations/anthropic/__init__.py
30
30
  airtrain/integrations/anthropic/credentials.py
31
+ airtrain/integrations/anthropic/list_models.py
31
32
  airtrain/integrations/anthropic/models_config.py
32
33
  airtrain/integrations/anthropic/skills.py
33
34
  airtrain/integrations/aws/__init__.py
@@ -59,6 +60,7 @@ airtrain/integrations/ollama/skills.py
59
60
  airtrain/integrations/openai/__init__.py
60
61
  airtrain/integrations/openai/chinese_assistant.py
61
62
  airtrain/integrations/openai/credentials.py
63
+ airtrain/integrations/openai/list_models.py
62
64
  airtrain/integrations/openai/models_config.py
63
65
  airtrain/integrations/openai/skills.py
64
66
  airtrain/integrations/sambanova/__init__.py
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "airtrain"
7
- version = "0.1.43"
7
+ version = "0.1.44"
8
8
  description = "A platform for building and deploying AI agents with structured skills"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes