Skip to content

Refactor: Split contentStreamTranslate() into single-responsibility methods#1016

Merged
tisfeng merged 2 commits intotisfeng:feature/add-doubao-modelfrom
Liaoworking:feature/add-doubao-model
Oct 18, 2025
Merged

Refactor: Split contentStreamTranslate() into single-responsibility methods#1016
tisfeng merged 2 commits intotisfeng:feature/add-doubao-modelfrom
Liaoworking:feature/add-doubao-model

Conversation

@Liaoworking
Copy link
Copy Markdown
Contributor

This PR in the branch feature/add-doubao-model is another part of PR #1005. It refactors the contentStreamTranslate() method by breaking down its implementation into several smaller, focused functions.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Refactor to split contentStreamTranslate() into focused helper methods for clarity and single-responsibility.

  • Extracted request building, URLRequest creation, HTTP response validation, stream processing, and SSE event handling into dedicated private methods.
  • Centralized unsupported language error construction.
  • Preserved streaming behavior while improving readability and separation of concerns.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread Easydict/Swift/Service/Doubao/DoubaoService.swift
Comment thread Easydict/Swift/Service/Doubao/DoubaoService.swift
@tisfeng
Copy link
Copy Markdown
Owner

tisfeng commented Oct 18, 2025

ok, looks good.

@tisfeng tisfeng merged commit 03340fa into tisfeng:feature/add-doubao-model Oct 18, 2025
2 checks passed
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.

3 participants