Skip to content

Conversation

jisunchung
Copy link
Contributor

@jisunchung jisunchung commented Oct 4, 2025

Purpose

Does this introduce a breaking change?

[ ] Yes
[x] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[x] New feature
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

README updated?

The top-level readme for this repo contains a link to each sample in the repo. If you're adding a new sample did you update the readme?

[ ] Yes
[ ] No
[x] N/A

How to Test

  • Get the code
git clone https://github.com/jisunchung/open-chat-playground.git
cd open-chat-playground
git checkout feature/371-update-app-title-connector-model
  • Test the code
dotnet build
dotnet run --project src/OpenChat.PlaygroundApp 
dotnet test --filter "FullyQualifiedName~OpenChat.PlaygroundApp.Tests.Components.Pages.Chat.ChatHeaderUITests"   
dotnet test --filter "FullyQualifiedName~OpenChat.PlaygroundApp.Tests.Extensions.AppSettingsExtensionsTests"

What to Check

  • 애플리케이션 헤더가 실행 시 전달된 인자에 따라 Connector Type과 Model Name을 동적으로 업데이트하는지 확인합니다.
  • 앱 헤더 관련 UI 테스트가 통과하는지 확인합니다.
  • AppSettingsExtensionsTests 가 모두 통과하는지 확인합니다.

Other Information

  • AppSettings인스턴스에 모델 이름을 저장하기 위한 Model프로퍼티를 추가했습니다.
  • 이 인스턴스를 IoC 컨테이너에 싱글톤으로 등록하고 UI 컴포넌트에서 직접 주입받아 사용하도록 하여, IConfiguration에 대한 직접적인 의존성을 제거했습니다.
  • AppSettingsExtensions를 추가하여 AppSettings 구성 로직을 중앙 집중화하고, 이에 대한 단위 테스트 (AppSettingsExtensionsTests)를 작성하여 코드의 안정성을 높였습니다.
  • 앱 타이틀을 "OpenChat Playground"로 업데이트하고 테스트 코드도 수정했습니다.
  • ConnectorType과 Model 값의 null/empty 체크와 ConnectorType의 유효성 검사를 포함한 UI 테스트를 추가했습니다.

@jisunchung jisunchung marked this pull request as draft October 4, 2025 13:19
@sikutisa sikutisa self-requested a review October 4, 2025 13:30
@jisunchung jisunchung changed the title Feature : update app title connector model Feature : update app title connector type and model name Oct 4, 2025
@jisunchung jisunchung marked this pull request as ready for review October 9, 2025 08:58
Copy link
Contributor

@sikutisa sikutisa left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!
좀 더 보겠습니다.

@sikutisa sikutisa self-requested a review October 9, 2025 16:15
Copy link
Contributor

@sikutisa sikutisa left a comment

Choose a reason for hiding this comment

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

일단은 Main 과 Conflict 해결하고 살펴보시면 될 것 같습니다.

- Add AppSettingsExtensions.cs with AddAppSettings() extension method
- Separate configuration logic from Program.cs for better maintainability
- Implement model name resolution with command-line argument priority
- Support all connector types with proper fallback to configuration defaults
- Follow existing project patterns (similar to EndpointExtensions)
@jisunchung
Copy link
Contributor Author

jisunchung commented Oct 10, 2025

Conflict 해결하고 Extensions 파일로 따로 분리하였습니다!

ConnectorTypeModel 프로퍼티 설정에서 명령줄 argumentConfiguration보다 우선되도록 구현을 추가했습니다.

@jisunchung jisunchung requested a review from sikutisa October 10, 2025 08:18
Copy link
Contributor

@sikutisa sikutisa left a comment

Choose a reason for hiding this comment

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

Extensions에 대한 테스트코드도 추가돼야 합니다.

@jisunchung jisunchung requested a review from sikutisa October 10, 2025 14:29
Copy link
Contributor

@sikutisa sikutisa left a comment

Choose a reason for hiding this comment

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

모델명을 가져오는 게 커넥터 타입에 따라서 3가지로 분기가 되는데

  1. Model
  2. DeploymentName
  3. Alias
    2, 3에 대한 경우가 추가되야 할 것 같습니다.

@jisunchung jisunchung requested a review from sikutisa October 13, 2025 06:20
Copy link
Contributor

@sikutisa sikutisa left a comment

Choose a reason for hiding this comment

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

2가지를 보완하면 좋을 것 같은데요.

  1. AddAppSettings을 할 때 오류가 발생하는 경우에 대한 테스트가 추가되면 좋겠습니다. 일단 configuration이나 settings가 null과 같이 정상적이지 않은 경우가 떠오르네요.
  2. Model, DeploymentName, Alias에 대해 switch로 분기해서 테스트를 하고 있는데, 따로 분리하는 게 좋아 보입니다. 테스트 메소드에서 if나 switch 사용은 지양하시는 게 맞습니다.

- Separated complex tests using [Theory] and switch statements into individual [Fact] tests for each connector type.
@jisunchung jisunchung requested a review from sikutisa October 14, 2025 08:03
Copy link
Contributor

@sikutisa sikutisa left a comment

Choose a reason for hiding this comment

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

아마 마지막 리뷰 코멘트일 것 같은데요.

테스트에서 사용하는 문자열 변수를 상수로 분리하는 게 어떨까요?
예를들어

private const string openaiModel =  "openai-default-model"

이런 식으로요.

@jisunchung jisunchung requested a review from sikutisa October 14, 2025 11:01
@jisunchung jisunchung requested a review from sikutisa October 14, 2025 11:50
Copy link
Contributor

@sikutisa sikutisa left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!

@sikutisa sikutisa merged commit ec8fdd8 into aliencube:main Oct 14, 2025
1 check passed
@justinyoo
Copy link
Contributor

@jisunchung @sikutisa ArgumentOptions.Parse() 메소드를 활용하면 더 쉽게 갈 수 있었는데, 추가 코드가 있었네요. 이 부분은 다시 PR로 변경하겠습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Playground app title change - connector type and model name

3 participants