-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
nik
committed
Feb 16, 2024
1 parent
202336b
commit 889f78f
Showing
1 changed file
with
42 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import requests | ||
import json | ||
|
||
response = requests.post( | ||
"http://localhost:30001/submit", | ||
json={ | ||
"agent": { | ||
"skills": [{ | ||
"type": "classification", | ||
"name": "text_classifier", | ||
"instructions": "Classify the text.", | ||
"input_template": "Text: {text}", | ||
"output_template": "Classification result: {label}", | ||
"labels": { | ||
"label": ['label1', 'label2', 'label3'] | ||
} | ||
}], | ||
"runtimes": { | ||
"default": { | ||
"type": "openai-chat", | ||
"model": "gpt-3.5-turbo-0125", | ||
"api_key": "..." | ||
} | ||
}, | ||
"environment": { | ||
"type": "kafka_filestream", | ||
"kafka_bootstrap_servers": "kafka:9093", | ||
"kafka_input_topic": "adala/input", | ||
"kafka_output_topic": "adala/output", | ||
"input_file": "s3://htx-test/input.csv", | ||
"output_file": "s3://htx-test/output.csv", | ||
"error_file": "s3://htx-test/errors.csv", | ||
"pass_through_columns": ["text", "id"] | ||
} | ||
} | ||
} | ||
) | ||
|
||
try: | ||
print(json.dumps(response.json(), indent=2)) | ||
except: | ||
print(response.text) |