Skip to content

Commit

Permalink
Merge pull request #673 from AFP-Medialab/assistant/machine-generated…
Browse files Browse the repository at this point in the history
…-text-post

changed GET to POST request
  • Loading branch information
Sallaa authored Dec 12, 2024
2 parents 449b993 + 5dfff4b commit cd6e64b
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ export default function assistantApiCalls() {
}
}
}

const callSourceCredibilityService = async (urlList) => {
return await callAsyncWithNumRetries(
MAX_NUM_RETRIES,
async () => {
if (urlList.length === 0) return null;

let urls = urlList.join(" ");

const result = await axios.post(
Expand All @@ -114,7 +114,7 @@ export default function assistantApiCalls() {
},
);
};

const callNewsFramingService = async (text) => {
return await callAsyncWithNumRetries(
MAX_NUM_RETRIES,
Expand Down Expand Up @@ -225,11 +225,11 @@ export default function assistantApiCalls() {
return await callAsyncWithNumRetries(
MAX_NUM_RETRIES,
async () => {
const result = await axios.get(
assistantEndpoint +
"kinit/machine-generated-text" +
"?text=" +
encodeURIComponent(text), // max URL length is 2048 characters
const result = await axios.post(
assistantEndpoint + "kinit/machine-generated-text",
{
content: text,
},
);
return result.data;
},
Expand Down

0 comments on commit cd6e64b

Please sign in to comment.