Skip to content

feat(agent): LLM 추론 강도를 FANCALL_OPENAI_REASONING_EFFORT로 설정 - #31

Merged
Lee-Soyeon merged 1 commit into
mainfrom
feat/openai-reasoning-effort
Oct 24, 2026
Merged

Lee-Soyeon merged 1 commit into
mainfrom
feat/openai-reasoning-effort

Conversation

@Lee-Soyeon

Copy link
Copy Markdown
Contributor

요약

LLM 추론 강도(reasoning_effort)를 환경변수 FANCALL_OPENAI_REASONING_EFFORT로 정할 수 있게 합니다. 비워 두면 지금과 같습니다.

#20 리뷰 요청에 따라 #20에서 분리한 PR입니다.

목적

thinking 모델은 추론 강도를 낮추지 않으면 첫 음성까지 지연이 길어 실시간 통화에 쓰기 어렵습니다. #20에서 첫인사를 Gemini(OpenAI 호환 API)로 확인하다 필요해진 설정입니다.

변경 사항

  • FancallModelSettings.openai_reasoning_effort (기본 None) → openai.LLM(reasoning_effort=...). None이면 NOT_GIVEN이라 플러그인 기본값 그대로입니다.
  • 타입은 openai.types.shared.ReasoningEffort라 허용 값이 설치된 openai SDK를 따릅니다. 잘못된 값은 워커 시작 시 ValidationError로 막힙니다.
  • backend/README.md 환경변수 표에 추가.

참고: #20 원래 코드와 다른 점

  • #20은 LiveKit Agents 1.8·openai 2.54 기준이라 "none"·"xhigh"·"max"까지 허용했습니다.
  • main은 livekit-agents 1.2.18·openai 2.6.1이라 ReasoningEffort가 minimal·low·medium·high뿐입니다. 그래서 이 PR에서는 "none"을 쓸 수 없습니다(로컬에서 거부 확인).
  • "none"이 필요하면 openai SDK를 올리는 별도 PR이 필요합니다.

테스트

  • make -C backend format / lint / type-check / unit-test 통과 (26개)
  • 설정 테스트: 기본값 없음, 환경변수 읽기, 잘못된 값 거부
  • thinking 모델로 실제 통화 시 첫 음성 지연 확인

🤖 Generated with Claude Code

thinking 모델은 추론 강도를 낮추지 않으면 첫 음성까지 지연이 길어 실시간 통화에 쓰기 어렵다.
비워 두면 기존 동작(플러그인 기본값) 그대로다. 허용 값은 설치된 openai SDK의 ReasoningEffort를 따른다.

#20에서 분리.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@ywkim ywkim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Lee-Soyeon 소연님, #20에서 분리해 주셔서 감사합니다. 승인합니다.


Generated by Claude Code

@Lee-Soyeon
Lee-Soyeon merged commit 8c1ded8 into main Oct 24, 2026
1 check passed
@Lee-Soyeon
Lee-Soyeon deleted the feat/openai-reasoning-effort branch October 24, 2026 08:04
Lee-Soyeon added a commit that referenced this pull request Oct 24, 2026
…#33)

openai Python SDK 를 2.6.1 → **2.54.0** 으로 올립니다. 이 PR 만으로는 동작이 바뀌지 않고,
#31 의 `FANCALL_OPENAI_REASONING_EFFORT` 에 `"none"` 을 넣을 수 있게 됩니다.

## 🎯 목적

- #20 의 원래 목적은 Gemini(OpenAI 호환 API)에서 추론을 꺼(`reasoning_effort="none"`)
첫 음성 지연을 줄이는 것입니다.
- main 의 openai 2.6.1 은 `ReasoningEffort` 가
`minimal`·`low`·`medium`·`high` 뿐이라 #31 에서 `"none"` 이 검증 단계에서 거부됩니다.
- PyPI 휠을 직접 확인하니 `"none"` 은 **2.8.0** 부터 들어 있습니다 (2.6.1 없음, 2.8.0 있음).

## 📦 변경 사항

- `pyproject.toml`: `openai = ">=1.0.0"` → `">=2.8.0,<3"`. 3.x 는 메이저
변경이라 막았습니다.
- `poetry.lock`: Poetry 2.4.3(기존 lock 과 같은 버전)으로 다시 잠갔고, 바뀐 패키지는
**openai 하나**입니다 (2.6.1 → 2.54.0).
- `livekit-plugins-openai` 1.2.18 의 요구 조건은 `openai[realtime]>=1.107.2` 라
범위 안입니다.

## 머지 순서

- #31 과 독립적으로 머지할 수 있습니다. 둘 다 들어가야 `"none"` 을 쓸 수 있습니다.
- #18 도 `poetry.lock` 을 바꿔서, 나중에 머지되는 쪽에서 lock 을 다시 잠가야 합니다.

## 테스트

- [x] 설치된 SDK 에서 `ReasoningEffort` = `none, minimal, low, medium, high,
xhigh, max` 확인
- [x] pylint 10.00, black 통과, mypy `Success: no issues found in 25
source files`, pyright 0 errors(`fancall`·`tests`·`main.py`), unit test
37개 통과
- [ ] 실제 통화(LiveKit + OpenAI/Gemini)는 확인하지 않았습니다

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Lee-Soyeon added a commit that referenced this pull request Nov 9, 2026
충돌: frontend/src/app/[lang]/page.tsx — 벨 울리는 동안 방을 준비하는 이 PR 구조를 두고, main의 dispatchAgent language 전달을 그 안에 합침

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants