Skip to content

Commit

Permalink
clean up comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bugsz committed Jan 7, 2025
1 parent 24ca6a3 commit 6b2db2a
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 99 deletions.
19 changes: 1 addition & 18 deletions examples/use_custom_dimensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 0 additions & 11 deletions ui/pages/add_characters.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
35 changes: 0 additions & 35 deletions ui/pages/add_evaluation_dimension.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
35 changes: 0 additions & 35 deletions ui/pages/add_scenarios.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 6b2db2a

Please sign in to comment.