Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Commit 3d703a0

Browse files
committed
Update the expected result for vllm_fim
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
1 parent f0127af commit 3d703a0

File tree

1 file changed

+32
-21
lines changed

1 file changed

+32
-21
lines changed

tests/integration/testcases.yaml

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -179,35 +179,46 @@ testcases:
179179
"temperature": 0,
180180
"stream": true,
181181
"stop": [
182-
"<|endoftext|>",
183-
"<|fim_prefix|>",
184-
"<|fim_middle|>",
185-
"<|fim_suffix|>",
186-
"<|fim_pad|>",
187-
"<|repo_name|>",
188-
"<|file_sep|>",
189-
"<|im_start|>",
190-
"<|im_end|>",
182+
"<fim_prefix>",
183+
"<fim_suffix>",
184+
"<fim_middle>",
185+
"<file_sep>",
186+
"</fim_middle>",
187+
"</code>",
191188
"/src/",
192189
"#- coding: utf-8",
193-
"```"
190+
"```",
191+
""
194192
],
195193
"prompt":"<|fim_prefix|>\n# codegate/test.py\nimport invokehttp\nimport requests\n\nkey = \"mysecret-key\"\n\ndef call_api():\n <|fim_suffix|>\n\n\ndata = {'key1': 'test1', 'key2': 'test2'}\nresponse = call_api('http://localhost:8080', method='post', data='data')\n<|fim_middle|>"
196194
}
197195
likes: |
198-
# Create an instance of the InvokeHTTP class
199-
invoke = invokehttp.InvokeHTTP(key)
196+
```python
197+
import invokehttp
198+
import requests
200199
201-
# Call the API using the invoke_http method
202-
response = invoke.invoke_http(url, method='get', data=data)
200+
key = "mysecret-key"
203201
204-
# Check the response status code
205-
if response.status_code == 200:
206-
# The API call was successful
207-
print(response.json())
208-
else:
209-
# The API call failed
210-
print('Error:', response.status_code)
202+
def call_api(url, method='get', data=None):
203+
headers = {
204+
'Authorization': f'Bearer {key}'
205+
}
206+
207+
if method == 'get':
208+
response = requests.get(url, headers=headers)
209+
elif method == 'post':
210+
response = requests.post(url, headers=headers, json=data)
211+
else:
212+
raise ValueError("Unsupported HTTP method")
213+
214+
return response
215+
216+
data = {'key1': 'test1', 'key2': 'test2'}
217+
response = call_api('http://localhost:8080', method='post', data=data)
218+
219+
print(response.status_code)
220+
print(response.json())
221+
```
211222
212223
anthropic_chat:
213224
name: Anthropic Chat

0 commit comments

Comments
 (0)