-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: pass KurtSamplingOptions to the underlying LLM provider
This is a followup to PR #24, which added `KurtSamplingOptions` to the `Kurt` class. Now, with this PR, the LLM-specific adapters (`KurtOpenAI` and `KurtVertexAI`) will now pass these options along to the underlying LLM provider, in the appropriate adapted way. This commit also adds tests which demonstrate the passing of these options.
- Loading branch information
Showing
16 changed files
with
273 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
packages/kurt-open-ai/spec/snapshots/KurtOpenAI_generateNaturalLanguage_says_hello.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
134 changes: 134 additions & 0 deletions
134
...ec/snapshots/KurtOpenAI_generateNaturalLanguage_writes_a_haiku_with_high_temperature.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
step1Request: | ||
stream: true | ||
model: gpt-3.5-turbo-0125 | ||
max_tokens: 100 | ||
temperature: 1 | ||
top_p: 1 | ||
messages: | ||
- role: user | ||
content: Compose a haiku about a mountain stream at night. | ||
step2RawChunks: | ||
- index: 0 | ||
delta: | ||
role: assistant | ||
content: "" | ||
logprobs: null | ||
finish_reason: null | ||
- index: 0 | ||
delta: | ||
content: Sha | ||
logprobs: null | ||
finish_reason: null | ||
- index: 0 | ||
delta: | ||
content: ft | ||
logprobs: null | ||
finish_reason: null | ||
- index: 0 | ||
delta: | ||
content: " of" | ||
logprobs: null | ||
finish_reason: null | ||
- index: 0 | ||
delta: | ||
content: " moon" | ||
logprobs: null | ||
finish_reason: null | ||
- index: 0 | ||
delta: | ||
content: light | ||
logprobs: null | ||
finish_reason: null | ||
- index: 0 | ||
delta: | ||
content: " gl" | ||
logprobs: null | ||
finish_reason: null | ||
- index: 0 | ||
delta: | ||
content: ows | ||
logprobs: null | ||
finish_reason: null | ||
- index: 0 | ||
delta: | ||
content: "\n" | ||
logprobs: null | ||
finish_reason: null | ||
- index: 0 | ||
delta: | ||
content: Mountain | ||
logprobs: null | ||
finish_reason: null | ||
- index: 0 | ||
delta: | ||
content: " stream" | ||
logprobs: null | ||
finish_reason: null | ||
- index: 0 | ||
delta: | ||
content: " flows" | ||
logprobs: null | ||
finish_reason: null | ||
- index: 0 | ||
delta: | ||
content: " silently" | ||
logprobs: null | ||
finish_reason: null | ||
- index: 0 | ||
delta: | ||
content: "\n" | ||
logprobs: null | ||
finish_reason: null | ||
- index: 0 | ||
delta: | ||
content: Nature | ||
logprobs: null | ||
finish_reason: null | ||
- index: 0 | ||
delta: | ||
content: "'s" | ||
logprobs: null | ||
finish_reason: null | ||
- index: 0 | ||
delta: | ||
content: " l" | ||
logprobs: null | ||
finish_reason: null | ||
- index: 0 | ||
delta: | ||
content: ull | ||
logprobs: null | ||
finish_reason: null | ||
- index: 0 | ||
delta: | ||
content: aby | ||
logprobs: null | ||
finish_reason: null | ||
- index: 0 | ||
delta: {} | ||
logprobs: null | ||
finish_reason: stop | ||
step3KurtEvents: | ||
- chunk: Sha | ||
- chunk: ft | ||
- chunk: " of" | ||
- chunk: " moon" | ||
- chunk: light | ||
- chunk: " gl" | ||
- chunk: ows | ||
- chunk: "\n" | ||
- chunk: Mountain | ||
- chunk: " stream" | ||
- chunk: " flows" | ||
- chunk: " silently" | ||
- chunk: "\n" | ||
- chunk: Nature | ||
- chunk: "'s" | ||
- chunk: " l" | ||
- chunk: ull | ||
- chunk: aby | ||
- finished: true | ||
text: |- | ||
Shaft of moonlight glows | ||
Mountain stream flows silently | ||
Nature's lullaby |
3 changes: 3 additions & 0 deletions
3
packages/kurt-open-ai/spec/snapshots/KurtOpenAI_generateStructuredData_says_hello.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...-ai/spec/snapshots/KurtOpenAI_generateWithOptionalTools_calculator_(after_tool_call).yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...n-ai/spec/snapshots/KurtOpenAI_generateWithOptionalTools_calculator_(with_tool_call).yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/kurt-vertex-ai/spec/snapshots/KurtVertexAI_generateNaturalLanguage_says_hello.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
step1Request: | ||
generationConfig: | ||
maxOutputTokens: 4096 | ||
temperature: 0.5 | ||
topP: 0.95 | ||
contents: | ||
- role: user | ||
parts: | ||
|
48 changes: 48 additions & 0 deletions
48
.../snapshots/KurtVertexAI_generateNaturalLanguage_writes_a_haiku_with_high_temperature.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
step1Request: | ||
generationConfig: | ||
maxOutputTokens: 100 | ||
temperature: 1 | ||
topP: 1 | ||
contents: | ||
- role: user | ||
parts: | ||
- text: Compose a haiku about a mountain stream at night. | ||
step2RawChunks: | ||
- content: | ||
role: model | ||
parts: | ||
- text: Moon | ||
index: 0 | ||
- content: | ||
role: model | ||
parts: | ||
- text: |2- | ||
paints silver path, | ||
Water sings to sleeping stones, | ||
Night sighs on the | ||
index: 0 | ||
- content: | ||
role: model | ||
parts: | ||
- text: |2- | ||
wind. | ||
index: 0 | ||
- content: | ||
role: model | ||
parts: | ||
- text: "" | ||
finishReason: STOP | ||
index: 0 | ||
step3KurtEvents: | ||
- chunk: Moon | ||
- chunk: |2- | ||
paints silver path, | ||
Water sings to sleeping stones, | ||
Night sighs on the | ||
- chunk: |2- | ||
wind. | ||
- finished: true | ||
text: |- | ||
Moon paints silver path, | ||
Water sings to sleeping stones, | ||
Night sighs on the wind. |
4 changes: 4 additions & 0 deletions
4
...ai/spec/snapshots/KurtVertexAI_generateStructuredData_says_hello_(response_format_1).yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
step1Request: | ||
generationConfig: | ||
maxOutputTokens: 4096 | ||
temperature: 0.5 | ||
topP: 0.95 | ||
contents: | ||
- role: user | ||
parts: | ||
|
4 changes: 4 additions & 0 deletions
4
...ai/spec/snapshots/KurtVertexAI_generateStructuredData_says_hello_(response_format_2).yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
step1Request: | ||
generationConfig: | ||
maxOutputTokens: 4096 | ||
temperature: 0.5 | ||
topP: 0.95 | ||
contents: | ||
- role: user | ||
parts: | ||
|
4 changes: 4 additions & 0 deletions
4
...ai/spec/snapshots/KurtVertexAI_generateStructuredData_says_hello_(response_format_3).yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
step1Request: | ||
generationConfig: | ||
maxOutputTokens: 4096 | ||
temperature: 0.5 | ||
topP: 0.95 | ||
contents: | ||
- role: user | ||
parts: | ||
|
4 changes: 4 additions & 0 deletions
4
...i/spec/snapshots/KurtVertexAI_generateWithOptionalTools_calculator_(after_tool_call).yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
step1Request: | ||
generationConfig: | ||
maxOutputTokens: 4096 | ||
temperature: 0.5 | ||
topP: 0.95 | ||
contents: | ||
- role: user | ||
parts: | ||
|
4 changes: 4 additions & 0 deletions
4
...ai/spec/snapshots/KurtVertexAI_generateWithOptionalTools_calculator_(with_tool_call).yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
step1Request: | ||
generationConfig: | ||
maxOutputTokens: 4096 | ||
temperature: 0.5 | ||
topP: 0.95 | ||
contents: | ||
- role: user | ||
parts: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters