diff --git a/examples/use_custom_dimensions.py b/examples/use_custom_dimensions.py index ff712224..48c7a195 100644 --- a/examples/use_custom_dimensions.py +++ b/examples/use_custom_dimensions.py @@ -192,24 +192,7 @@ def run_simple_sample_with_custom_samples( if __name__ == "__main__": - """ - A sample dimension: - custom_dimensions: list[dict[str, Union[str, int]]] = [ - { - "name": "transactivity", - "description": "Analyze the provided social interaction episode between the given pair/team, focusing on identifying instances of transactive exchanges. Evaluate the level of transactivity by considering the following aspects: elaboration, building upon ideas, questioning, argumentation. Analyze whether these transactive patterns persist consistently across the entire interaction or if there are notable variations throughout the exchange. In the 'reasoning' field, provide a comprehensive account of the logic and thought process that led to your conclusion. Consider how the observed instances of transactivity contribute to or detract from the overall quality and depth of the interaction. In the 'score' field, provide an integer score ranging from 0 to 10, where a higher score indicates a higher level of transactivity.", - "range_high": 10, - "range_low": 0, - }, - { - "name": "verbal_equity", - "description": "Analyze the script and measure the level of verbal equity reflected in the interaction between the agents. And then analyze the extent to which the interaction shows a balanced distribution of speaking opportunities among team members. In the 'reasoning' field, provide a comprehensive account of the logic or thought process that led you to your conclusion. Further, provide an integer score ranging from 0 and 10 in the 'score' field. A higher score indicates a higher level of verbal equity.", - "range_high": 10, - "range_low": 0, - }, - ] - """ - + # here is a sample dimension custom_dimensions: list[dict[str, Union[str, int]]] = [ { "name": "transactivity", diff --git a/ui/pages/add_characters.py b/ui/pages/add_characters.py index 65986fb1..0bf2f698 100644 --- a/ui/pages/add_characters.py +++ b/ui/pages/add_characters.py @@ -1,14 +1,3 @@ -""" -Definition -@app.post("/agents", response_model=str) -async def create_agent(agent: BaseAgentProfile) -> str: - agent_profile = BaseAgentProfile(**agent.model_dump()) - agent_profile.save() - pk = agent_profile.pk - assert pk is not None - return pk -""" - import streamlit as st import requests diff --git a/ui/pages/add_evaluation_dimension.py b/ui/pages/add_evaluation_dimension.py index 56c7c1e0..e838cd1a 100644 --- a/ui/pages/add_evaluation_dimension.py +++ b/ui/pages/add_evaluation_dimension.py @@ -1,38 +1,3 @@ -""" -Definition -@app.get( - "/evaluation_dimensions", response_model=dict[str, list[CustomEvaluationDimension]] -) -async def get_evaluation_dimensions() -> dict[str, list[CustomEvaluationDimension]]: - custom_evaluation_dimensions: dict[str, list[CustomEvaluationDimension]] = {} - all_custom_evaluation_dimension_list = CustomEvaluationDimensionList.all() - for custom_evaluation_dimension_list in all_custom_evaluation_dimension_list: - assert isinstance( - custom_evaluation_dimension_list, CustomEvaluationDimensionList - ) - custom_evaluation_dimensions[custom_evaluation_dimension_list.name] = [ - CustomEvaluationDimension.get(pk=pk) - for pk in custom_evaluation_dimension_list.dimension_pks - ] - return custom_evaluation_dimensions - -class CustomEvaluationDimensionsWrapper(BaseModel): - pk: str = "" - name: str = Field( - default="", description="The name of the custom evaluation dimension list" - ) - dimensions: list[CustomEvaluationDimension] = Field( - default=[], description="The dimensions of the custom evaluation dimension list" - ) - -class CustomEvaluationDimension(JsonModel): - name: str = Field(index=True) - description: str = Field(index=True) - range_high: int = Field(index=True) - range_low: int = Field(index=True) - -""" - import streamlit as st import requests from sotopia.database import BaseCustomEvaluationDimension diff --git a/ui/pages/add_scenarios.py b/ui/pages/add_scenarios.py index c6118d27..dd05cd98 100644 --- a/ui/pages/add_scenarios.py +++ b/ui/pages/add_scenarios.py @@ -1,38 +1,3 @@ -""" -Definition -@app.post("/scenarios/", response_model=str) -async def create_scenario(scenario: EnvironmentProfileWrapper) -> str: - scenario_profile = EnvironmentProfile(**scenario.model_dump()) - scenario_profile.save() - pk = scenario_profile.pk - assert pk is not None - return pk - -class EnvironmentProfileWrapper(BaseModel): - Wrapper for EnvironmentProfile to avoid pydantic v2 issues - - codename: str - source: str = "" - scenario: str = "" - agent_goals: list[str] = [] - relationship: Literal[0, 1, 2, 3, 4, 5] = 0 - age_constraint: str | None = None - occupation_constraint: str | None = None - agent_constraint: list[list[str]] | None = None - tag: str = "" - -class RelationshipType(IntEnum): - stranger = 0 - know_by_name = 1 - acquaintance = 2 - friend = 3 - romantic_relationship = 4 - family_member = 5 - -The age constraint of the environment, a list of tuples, each tuple is a range of age, e.g., '[(18, 25), (30, 40)]' -means the environment is only available to agent one between 18 and 25, and agent two between 30 and 40 -""" - import streamlit as st from ui.rendering import local_css from sotopia.database import BaseEnvironmentProfile, RelationshipType