Customer Success Talks: Code Interpreter Use Cases

⭐️This is Day 17 of the JAPAN AI Advent Calendar 2025⭐️
Hello, I'm Aoki from the Customer Success Department at JAPAN AI.
It might seem strange for someone who isn't an engineer to write a tech blog, but this time I'd like to write a blog that only I can write, as someone who regularly faces customers' "concerns about generative AI utilization."
That said, I don't think it would be interesting to introduce cases like "you can create meeting minutes with AI" or "you can brainstorm ideas" at this point, so I'd like to introduce some slightly niche examples that will help you feel the potential of generative AI.
Introduction: "Specialized but Monotonous Tasks" Are Where AI Shines
When you hear "business efficiency with generative AI," many people might think of routine tasks like document creation and summarization. However, what really steals time from our clients is "work that requires specialized knowledge but no creativity."
For example, in warehouse or factory network design, the task of placing Wi-Fi APs (Access Points) on floor plans. While this requires specialized knowledge, it's an extremely rule-based task of "detecting areas and placing at regular intervals."
Designers process dozens of drawings per project, manually placing icons in PowerPoint—sometimes spending hours (or even days) on this repetition.
"Couldn't we have AI handle this kind of work?"
This voice from the field led to the AP plot diagram automatic generation AGENT I'll introduce today.
Effective Use of Code Interpreter: Giving AI "Hands"
Architecture Core
As a prerequisite, this AGENT uses a technology called Code Interpreter. Code Interpreter is a mechanism that gives LLMs a sandboxed Python execution environment. It's available with various LLMs including OpenAI, Anthropic Claude, and Google Gemini, operating with the following processing flow:
User Input (Natural Language + Images)
↓
LLM (Intent Understanding + Code Generation)
↓
Sandboxed Python Runtime
├─ numpy, pandas, matplotlib
├─ opencv-python (Image Processing)
├─ python-pptx (PowerPoint Operations)
└─ pillow, scipy, etc.
↓
Output (Images/PPTX/CSV etc.)Key Points:
- LLM understands "what should be done" and converts to Python code
- Code executes in isolated environment with results fed back to LLM
- If errors occur, LLM self-corrects and retries
Comparison with Traditional Methods
| Method | Flexibility | Implementation Cost | Maintainability | Notes |
|---|---|---|---|---|
| Manual Work | ◎ | - | - | Takes too much time |
| RPA (UiPath etc.) | △ | High | Low | Breaks with UI changes |
| Fixed Scripts | × | Medium | Low | Weak to specification changes |
| Code Interpreter | ◎ | Low | High | Natural language instructions possible |
The true value of Code Interpreter lies in balancing "versatility of natural language instructions" with "reliability of code execution."
Accuracy Improvement Through System Prompts
By pre-writing examples of code you want executed in system prompts, you can suppress randomness in code interpretation and execution tasks.
In this AGENT, we incorporated the following elements into system prompts:
- Specific HSV range values for color detection
- Coordinate conversion formulas (Pixel→EMU)
- Usage examples of python-pptx library
- Error handling patterns
This enables LLM to execute reproducible processing rather than generating code "somehow."
Technical Challenges
The core of this AGENT lies in combining LLM (Large Language Model) with OpenCV image processing. Here are three technical points explained:
1. Area Recognition Using HSV Color Space
Floor plan images are typically color-coded by area (mezzanine areas in yellow, AMR areas in light blue, etc.). We detect these using
HSV color space.
import cv2
import numpy as np
# Convert image to HSV color space
hsv = cv2.cvtColor(image, cv2.COLOR_BGR2HSV)
# Detect yellow areas
yellow_lower = np.array([20, 30, 200]) # H(Hue), S(Saturation), V(Value)
yellow_upper = np.array([40, 150, 255])
yellow_mask = cv2.inRange(hsv, yellow_lower, yellow_upper)
# Contour detection
contours, _ = cv2.findContours(yellow_mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)Why HSV?
RGB color space is easily affected by lighting, making "yellow" definition ambiguous. HSV judges color by Hue, making it resistant to brightness changes and able to handle quality variations in practical drawings.
2. Coordinate System Conversion
The biggest technical challenge was accurately converting coordinates obtained from image processing to PowerPoint's coordinate system.
PowerPoint uses EMU (English Metric Units):
- 1 inch = 914,400 EMU
Images are typically
96 DPI (Dots Per Inch)
from pptx.util import Emu
# Convert pixel coordinates to EMU
DPI = 96
left_emu = Emu(int(x_pixel / DPI * 914400))
top_emu = Emu(int(y_pixel / DPI * 914400))
# Place icon in PowerPoint
shape = slide.shapes.add_picture(
'ap_icon.png',
left=left_emu,
top=top_emu,
width=Emu(457200) # 0.5 inch
)What happens if this conversion is wrong?
While preview images might look correct, positions shift when opened in PowerPoint. In initial tests, coordinates were off by dozens of pixels, causing AP icons to be placed outside walls.
Accurate DPI value understanding and precise EMU conversion formula implementation were essential.
3. Flexible Instruction Interpretation by LLM
What's decisively different from traditional programs is the ability to handle natural language instructions.
For example, the following ambiguous instructions are processable:
- "Place at 10m intervals in blue-filled areas"
- "Place one row in center of mezzanine area, place at both ends of AMR area"
- "Place at least 1m away from walls"
LLM interprets such instructions as follows:
- Acquire image analysis results (area coordinates from color detection)
- Convert physical constraints (10m intervals, distance from walls) to formulas
- Generate placement logic as Python code
- Execute and preview, fine-tune as needed
This "understand→code→execute→verify" cycle that LLM can autonomously run is revolutionary.
Practical Application
Before
- 30 minutes to 1 hour per floor plan processing
- Hours to days for multiple areas and floors
- Start over from scratch for revision requests
- Risk of human error (placement mistakes, interval mistakes)
After
- Floor plan processing in minutes
- Batch processing of multiple sheets possible
- Revisions regenerated instantly by changing instructions
- Placement rules clarified, quality standardized
Actual Results
At one network design company, over 50 floor plans were processed monthly:
- Previously: 50 sheets × 30 minutes = 25 hours/month
- After AGENT introduction: 50 sheets × 5 minutes = about 4 hours/month
- Reduction effect: About 84% time savings
The designer said, "I was freed from simple tasks and could focus on actual design work."
Summary: The Essence of AGENTS
This AP plot diagram AGENT demonstrates the essence of "AI AGENT."
Traditional RPA vs AI AGENT
| Feature | Traditional RPA | AI AGENT |
|---|---|---|
| Instruction Method | Flowchart/Script | Natural Language |
| Flexibility | Only predefined procedures | Judges according to situation |
| Data Support | Only structured data | Unstructured data (images etc.) also possible |
| Error Response | Stops | Self-correction・Retry |
AI AGENT can automate most "work requiring specialized knowledge but no creativity" through the following capabilities:
- Interpret ambiguous instructions and convert to appropriate actions
- Structurally understand/organize unstructured data like images
- Flexibly generate and execute code according to situations
- Self-correct errors and try until achieving objectives
Future Prospects
At JAPAN AI, we customize such AGENTS by industry and business type, contributing to Japanese companies' productivity improvement.
While today's AP plot diagram AGENT is a specific domain example in network design, similar approaches can be applied to tasks like:
- Equipment placement on architectural drawings (lighting, sprinklers, etc.)
- Fixture placement for store layouts
- Factory line equipment placement simulation
- Furniture placement proposals for real estate drawings
If you have tasks where "rules are clear but manual work takes time," please consult with us.
Final Thoughts
Though I've written engineer-like content pretentiously, these technologies weren't ideas I came up with from scratch.
I needed to give AI specific instructions about what I wanted to do, sample materials I wanted created, and the target state. Honestly, creating the initial prompt took over 5 minutes, and I went through many trials and errors to improve coordinate conversion accuracy.
But being able to create this level of AI AGENT with just a few trials and errors shows how amazing generative AI is.
I've realized that what's important isn't "perfect instructions" but "specific instructions" and "courage to try."
I'll continue working hard to propose optimal AI AGENT utilization for customer challenges.
【JAPAN AI】カスタマーサクセス | 株式会社ジーニーhrmos.co