Skip to content

Commit 22443c7

Browse files
committed
OpenAIMultiServiceAdapter - changing the type of underlyings from Seq to varargs + some comments
1 parent e139519 commit 22443c7

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

openai-core/src/main/scala/io/cequence/openaiscala/service/OpenAIMultiServiceAdapter.scala

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,18 @@ private class OpenAIMultiServiceRandomAccessAdapter(
3434
protected def calcIndex = Random.nextInt(count)
3535
}
3636

37+
/**
38+
* Load distribution for multiple OpenAIService instances using:
39+
* - rotation type (aka round robin)
40+
* - random access/order
41+
*/
3742
object OpenAIMultiServiceAdapter {
3843

39-
def ofRotationType(underlyings: Seq[OpenAIService]): OpenAIService =
44+
// maybe calling it "round robin" would be better?
45+
def ofRotationType(underlyings: OpenAIService*): OpenAIService =
4046
new OpenAIMultiServiceRotationAdapter(underlyings)
4147

42-
def ofRandomAccessType(underlyings: Seq[OpenAIService]): OpenAIService =
48+
// TODO: rename to ofRandomOrder
49+
def ofRandomAccessType(underlyings: OpenAIService*): OpenAIService =
4350
new OpenAIMultiServiceRandomAccessAdapter(underlyings)
4451
}

0 commit comments

Comments
 (0)