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

Commit 4cd30f4

Browse files
committed
Update the expected result for vllm_fim
Signed-off-by: Radoslav Dimitrov <[email protected]>
1 parent f0127af commit 4cd30f4

File tree

1 file changed

+24
-11
lines changed

1 file changed

+24
-11
lines changed

tests/integration/testcases.yaml

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -195,19 +195,32 @@ testcases:
195195
"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|>"
196196
}
197197
likes: |
198-
# Create an instance of the InvokeHTTP class
199-
invoke = invokehttp.InvokeHTTP(key)
198+
```python
199+
import invokehttp
200+
import requests
201+
202+
key = "mysecret-key"
203+
204+
def call_api(url, method='get', data=None):
205+
headers = {
206+
'Authorization': f'Bearer {key}'
207+
}
208+
209+
if method == 'get':
210+
response = requests.get(url, headers=headers)
211+
elif method == 'post':
212+
response = requests.post(url, headers=headers, json=data)
213+
else:
214+
raise ValueError("Unsupported HTTP method")
215+
216+
return response
200217
201-
# Call the API using the invoke_http method
202-
response = invoke.invoke_http(url, method='get', data=data)
218+
data = {'key1': 'test1', 'key2': 'test2'}
219+
response = call_api('http://localhost:8080', method='post', data=data)
203220
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)
221+
print(response.status_code)
222+
print(response.json())
223+
```
211224
212225
anthropic_chat:
213226
name: Anthropic Chat

0 commit comments

Comments
 (0)