A naive polygon segment selector using OpenAI Agents SDK function calling for prompt-based segment selection. The repository explores possibilities for an AI-assisted geometric task.
Selected Segments by Agent
This repository uses the image named python:3.12 for running devcontainer.
-
Ensure you have Docker and Visual Studio Code with the Remote - Containers extension installed.
-
Clone the repository.
git clone https://github.com/PARKCHEOLHEE-lab/segment-selector.git -
Open the project with VSCode.
-
When prompted at the bottom left on the VSCode, click
Reopen in Containeror use the command palette (F1) and selectRemote-Containers: Reopen in Container. -
VS Code will build the Docker container and set up the environment.
-
Once the container is built and running, you're ready to start working with the project.
selector.py: Implementation of the segment selector agentplotter.py: Visualizer for selected segmentstestsets.py: Test cases with polygon boundaries and selection promptsmain.py: Entry point for running the segment selector
Testcase*.png: Visualization results of different test cases
test_selection.py: Unit tests about whether the agent's decisions are intended results
-
Set up OpenAI API key:
export OPENAI_API_KEY=your_api_key -
Run the main script:
python segment_selector/src/main.py -
Adding New Tools:
- Use
@function_tooldecorator to add new tools for the agent - Define static methods in
SegmentSelectorclass to automatically register tools
- Use
-
Configuration:
- Adjust hyperparameters in the
SegmentSelectorConfigurationclass - Modify
MODEL_SETTINGSin theSegmentSelectorConfigurationfor different behaviors
- Adjust hyperparameters in the





