원클릭으로
file-store
Using FileStore to wrap files (images, PDFs, data) for use in EDSL survey scenarios.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Using FileStore to wrap files (images, PDFs, data) for use in EDSL survey scenarios.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Patterns for creating EDSL AgentLists from various sources: lists, CSV, Excel, DataFrame, and programmatic combinations.
Saving EDSL objects locally and publishing them to Coop (Expected Parrot's servers).
Templates for the standard EDSL study files: survey, scenarios, agents, models, and create_results.py.
Error logging protocol using append-only JSONL format (errors.jsonl).
Developer tool: find the most recent errors.jsonl from an agent run, diagnose root causes, and interactively patch the agent's instruction files to prevent recurrence.
Launching EDSL surveys for real human respondents via humanize, including scenario methods, Prolific integration, and retrieving responses.
| name | file-store |
| description | Using FileStore to wrap files (images, PDFs, data) for use in EDSL survey scenarios. |
Use FileStore(path=...) to wrap any file for use in surveys:
from edsl import FileStore
fs = FileStore(path="photo.png")
This works with many file types: images (png, jpeg, svg), documents (pdf, docx, pptx), data (csv, xlsx, json), text (txt, md, html), code (py, sql), databases (db/sqlite), video (mp4, webm), and LaTeX.
Pass a FileStore as a scenario value, then reference it in question text with Jinja2 templating:
from edsl import FileStore, Scenario, QuestionFreeText, Survey
fs = FileStore(path="chart.png")
scenario = Scenario({"file_path": fs})
q = QuestionFreeText(
question_name="describe",
question_text="What is in this image: {{ scenario.file_path }}?"
)
survey = Survey([q])
results = survey.by(scenario).run()
The {{ scenario.file_path }} placeholder is replaced with the file content at runtime, so the model sees the actual image/document.
Process many files by creating a scenario for each:
from edsl import FileStore, Scenario, ScenarioList
filenames = ["doc1.pdf", "doc2.pdf", "doc3.pdf"]
scenarios = ScenarioList([
Scenario({"file_path": FileStore(path=f)}) for f in filenames
])
results = survey.by(scenarios).run()
Scenarios can contain both files and regular data:
scenario = Scenario({
"file_path": FileStore(path="resume.pdf"),
"job_title": "Software Engineer"
})
q = QuestionFreeText(
question_name="evaluate",
question_text="Review this resume: {{ scenario.file_path }}. How well does the candidate fit the role of {{ job_title }}?"
)
| Task | Code |
|---|---|
| Create from file | FileStore(path="file.png") |
| Wrap in scenario | Scenario({"file_path": fs}) |
| Reference in question | {{ scenario.file_path }} |
| Multiple files | ScenarioList([Scenario({"file_path": FileStore(path=f)}) for f in files]) |
| Extract text | fs.extract_text() |
| CSV to scenarios | FileStore(path="data.csv").to_scenario_list() |
| Get MIME type | fs.mime_type |
| Check if image | fs.is_image() |