types
types
¶
Core data types for SkillOrchestra.
- Skill
- AgentProfile
- BetaCompetence
- ModeMetadata
- RoutingInsight
- CostStats
Classes¶
BetaCompetence
dataclass
¶
Bayesian competence estimate for an agent on a specific skill.
skill_scores / get_competence use empirical_rate (successes/attempts)
CostStats
dataclass
¶
CostStats(avg_prompt_tokens: float = 0.0, avg_completion_tokens: float = 0.0, avg_latency_s: float = 0.0, avg_cost_usd: float = 0.0, avg_completion_cost_usd: float = 0.0, avg_prompt_cost_usd: float = 0.0, total_executions: int = 0)
Execution cost statistics for an agent under a specific mode.
Tracks both total cost (prompt + completion) and completion-only cost separately, since completion cost is the variable component that differs most between models (prompt cost is roughly constant for the same query).
Functions¶
update
¶
update(prompt_tokens: float, completion_tokens: float, latency_s: float, cost_usd: float, completion_cost_usd: float = 0.0, prompt_cost_usd: float = 0.0) -> None
Incremental running-average update.
Source code in src/openjarvis/agents/hybrid/skillorchestra/types.py
RoutingInsight
dataclass
¶
RoutingInsight(insight_id: str = (lambda: hex[:8])(), content: str = '', insight_type: str = '', evidence_query_ids: List[str] = list(), confidence: float = 0.0)
A single routing insight learned from execution traces
ModeMetadata
dataclass
¶
ModeMetadata(mode: str = '', description: str = '', insights: List[RoutingInsight] = list())
Mode-level routing metadata.
SkillProvenance
dataclass
¶
SkillProvenance(discovered_from_queries: List[str] = list(), positive_trajectories: List[str] = list(), negative_trajectories: List[str] = list(), discovery_round: int = 0, refinement_history: List[Dict[str, Any]] = list())
Tracks how and why a skill was discovered.
Skill
dataclass
¶
Skill(skill_id: str = '', name: str = '', description: str = '', indicators: List[str] = list(), examples: List[str] = list(), mode: str = '', parent_skill_id: Optional[str] = None, provenance: SkillProvenance = SkillProvenance())
AgentProfile
dataclass
¶
AgentProfile(agent_id: str = '', mode: str = '', model_name: str = '', tools: List[str] = list(), skill_competence: Dict[str, BetaCompetence] = dict(), total_attempts: int = 0, total_successes: int = 0, cost_stats: CostStats = CostStats(), routing_signals: List[str] = list(), strengths: List[str] = list(), weaknesses: List[str] = list())
Agent profile for skill-aware orchestration.
Attributes¶
overall_success_rate
property
¶
Overall success rate (trajectory-level when available, else skill-level).
Functions¶
get_competence
¶
Get empirical success rate for a skill. Returns 0 if unseen.
Source code in src/openjarvis/agents/hybrid/skillorchestra/types.py
get_competence_dist
¶
get_competence_dist(skill_id: str) -> BetaCompetence
Get full Beta distribution for a skill, creating with prior if unseen.
Source code in src/openjarvis/agents/hybrid/skillorchestra/types.py
update_competence
¶
weighted_competence
¶
Compute weighted competence: sum w_{t,sigma} * alpha/(alpha+beta).
Source code in src/openjarvis/agents/hybrid/skillorchestra/types.py
category_competence
¶
Aggregate competence on all skills under a category (skill_id prefix).
E.g. category_competence('entertainment_knowledge') = avg of get_competence(s) for all s where s.startswith('entertainment_knowledge.').
Source code in src/openjarvis/agents/hybrid/skillorchestra/types.py
category_competence_for_skills
¶
Category-level competence for hierarchical tie-breaking.
Extracts parent categories from active_skill_ids (e.g. 'entertainment_knowledge' from 'entertainment_knowledge.episodic_competition_outcome'), computes category_competence for each, returns average.