Spaces:
Running
Running
David de la Iglesia Castro
commited on
Add llama_index framework (#46)
Browse files* Add llama_index framework
* Fix missing `main_agent`
examples/llama_index_single_agent.yaml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
location: Pontevedra
|
2 |
+
date: 2025-04-02 12:00
|
3 |
+
max_driving_hours: 2
|
4 |
+
|
5 |
+
framework: llama_index
|
6 |
+
|
7 |
+
main_agent:
|
8 |
+
model_id: o3-mini
|
src/surf_spot_finder/cli.py
CHANGED
@@ -29,9 +29,9 @@ def find_surf_spot(
|
|
29 |
config = Config.model_validate(yaml.safe_load(Path(config_file).read_text()))
|
30 |
|
31 |
if not config.main_agent.instructions:
|
32 |
-
if config.
|
33 |
config.main_agent.instructions = SYSTEM_PROMPT
|
34 |
-
elif config.
|
35 |
config.main_agent.instructions = SINGLE_AGENT_SYSTEM_PROMPT
|
36 |
|
37 |
logger.info("Setting up tracing")
|
|
|
29 |
config = Config.model_validate(yaml.safe_load(Path(config_file).read_text()))
|
30 |
|
31 |
if not config.main_agent.instructions:
|
32 |
+
if config.framework == AgentFramework.SMOLAGENTS:
|
33 |
config.main_agent.instructions = SYSTEM_PROMPT
|
34 |
+
elif config.framework == AgentFramework.OPENAI:
|
35 |
config.main_agent.instructions = SINGLE_AGENT_SYSTEM_PROMPT
|
36 |
|
37 |
logger.info("Setting up tracing")
|
src/surf_spot_finder/config.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
from typing import Annotated
|
2 |
|
3 |
from any_agent import AgentFramework
|
4 |
-
from any_agent.
|
5 |
from pydantic import AfterValidator, BaseModel, ConfigDict, FutureDatetime, PositiveInt
|
6 |
import yaml
|
7 |
|
@@ -32,8 +32,8 @@ class Config(BaseModel):
|
|
32 |
|
33 |
framework: AgentFramework
|
34 |
|
35 |
-
main_agent:
|
36 |
-
managed_agents: list[
|
37 |
|
38 |
@classmethod
|
39 |
def from_yaml(cls, yaml_path: str) -> "Config":
|
|
|
1 |
from typing import Annotated
|
2 |
|
3 |
from any_agent import AgentFramework
|
4 |
+
from any_agent.config import AgentConfig
|
5 |
from pydantic import AfterValidator, BaseModel, ConfigDict, FutureDatetime, PositiveInt
|
6 |
import yaml
|
7 |
|
|
|
32 |
|
33 |
framework: AgentFramework
|
34 |
|
35 |
+
main_agent: AgentConfig
|
36 |
+
managed_agents: list[AgentConfig] | None = None
|
37 |
|
38 |
@classmethod
|
39 |
def from_yaml(cls, yaml_path: str) -> "Config":
|