|
21 | 21 | presence_penalty: 1, |
22 | 22 | repetition_penalty: 1, |
23 | 23 | seed: 1, |
| 24 | + store: false, |
24 | 25 | tools: [{type: "function", function: {name: "Temp", parameters: {substance: "H20"}}}], |
25 | 26 | tool_choice: "auto", |
26 | 27 | logit_bias: {"2435": -100, "640": -100} |
|
36 | 37 |
|
37 | 38 | context "delegations" do |
38 | 39 | it "filters parameters to those provided" do |
39 | | - params_with_extras = valid_params.merge(blah: 1, beep: "beep", boop: "boop") |
| 40 | + params_with_extras = valid_params.merge(blah: 1, beep: "beep", boop: "boop", store: true) |
40 | 41 | chat_params = described_class.new |
41 | 42 | chat_params.alias_field(:max_tokens, as: :max_tokens_to_sample) |
42 | 43 | expect(chat_params.to_params(params_with_extras)).to match( |
|
55 | 56 | presence_penalty: 1, |
56 | 57 | repetition_penalty: 1, |
57 | 58 | seed: 1, |
| 59 | + store: true, |
58 | 60 | tools: [{type: "function", function: {name: "Temp", parameters: {substance: "H20"}}}], |
59 | 61 | tool_choice: "auto", |
60 | 62 | logit_bias: {"2435": -100, "640": -100} |
|
69 | 71 | expect(chat_params.to_params(valid_params)[:max_tokens]).to eq(100) |
70 | 72 | end |
71 | 73 | end |
| 74 | + |
| 75 | + context "store parameter" do |
| 76 | + it "passes store parameter to to_params" do |
| 77 | + chat_params = described_class.new |
| 78 | + params = chat_params.to_params(store: true) |
| 79 | + expect(params[:store]).to eq(true) |
| 80 | + end |
| 81 | + |
| 82 | + it "defaults to nil" do |
| 83 | + chat_params = described_class.new |
| 84 | + params = chat_params.to_params({}) |
| 85 | + expect(params[:store]).to be_nil |
| 86 | + end |
| 87 | + end |
72 | 88 | end |
0 commit comments