We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents aa391b1 + a5cafb5 commit 8ed1e96Copy full SHA for 8ed1e96
1 file changed
agentstack/proj_templates.py
@@ -1,4 +1,4 @@
1
-from typing import Optional, Literal
+from typing import Literal
2
import os, sys
3
from pathlib import Path
4
import pydantic
@@ -98,6 +98,16 @@ def write_to_file(self, filename: Path):
98
99
@classmethod
100
def from_template_name(cls, name: str) -> 'TemplateConfig':
101
+ # if url
102
+ if name.startswith('https://'):
103
+ return cls.from_url(name)
104
+
105
+ # if .json file
106
+ if name.endswith('.json'):
107
+ path = os.getcwd() / Path(name)
108
+ return cls.from_file(path)
109
110
+ # if named template
111
path = get_package_path() / f'templates/proj_templates/{name}.json'
112
if not name in get_all_template_names():
113
raise ValidationError(f"Template {name} not bundled with agentstack.")
0 commit comments