fix: remove deprecated fields from retell ai (#21790)
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { WEBAPP_URL } from "@calcom/lib/constants";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { fetcher } from "@calcom/lib/retellAIFetcher";
|
||||
import { safeStringify } from "@calcom/lib/safeStringify";
|
||||
@@ -77,7 +76,6 @@ class CreateRetellLLMCommand implements Command<TCreateRetellLLMSchema> {
|
||||
body: JSON.stringify({
|
||||
general_prompt: this.props.generalPrompt,
|
||||
begin_message: this.props.beginMessage,
|
||||
inbound_dynamic_variables_webhook_url: `${WEBAPP_URL}/api/get-inbound-dynamic-variables`,
|
||||
general_tools: [
|
||||
{
|
||||
type: "end_call",
|
||||
@@ -102,13 +100,6 @@ class CreateRetellLLMCommand implements Command<TCreateRetellLLMSchema> {
|
||||
}),
|
||||
}).then(ZCreateRetellLLMSchema.parse);
|
||||
|
||||
const llmWebSocketUrlToBeUpdated = createdRetellLLM.inbound_dynamic_variables_webhook_url;
|
||||
await updateAgentWebsocketUrl(
|
||||
this.props.yourPhoneNumber,
|
||||
llmWebSocketUrlToBeUpdated,
|
||||
createdRetellLLM.llm_id
|
||||
);
|
||||
|
||||
return createdRetellLLM;
|
||||
} catch (error) {
|
||||
log.error("Unable to Create Retell LLM", safeStringify(error));
|
||||
@@ -141,17 +132,9 @@ class UpdateRetellLLMCommand implements Command<TGetRetellLLMSchema> {
|
||||
body: JSON.stringify({
|
||||
general_prompt: this.props.generalPrompt,
|
||||
begin_message: this.props.beginMessage,
|
||||
inbound_dynamic_variables_webhook_url: `${WEBAPP_URL}/api/get-inbound-dynamic-variables`,
|
||||
}),
|
||||
}).then(ZGetRetellLLMSchema.parse);
|
||||
|
||||
const llmWebSocketUrlToBeUpdated = updatedRetellLLM.inbound_dynamic_variables_webhook_url;
|
||||
await updateAgentWebsocketUrl(
|
||||
this.props.yourPhoneNumber,
|
||||
llmWebSocketUrlToBeUpdated,
|
||||
updatedRetellLLM.llm_id
|
||||
);
|
||||
|
||||
return updatedRetellLLM;
|
||||
} catch (err) {
|
||||
log.error("Unable to Update Retell LLM", safeStringify(err));
|
||||
|
||||
@@ -123,7 +123,7 @@ export const ZCreateRetellLLMSchema = z
|
||||
.object({
|
||||
llm_id: z.string(),
|
||||
llm_websocket_url: z.string().optional(),
|
||||
inbound_dynamic_variables_webhook_url: z.string(),
|
||||
inbound_dynamic_variables_webhook_url: z.string().optional(),
|
||||
})
|
||||
.passthrough();
|
||||
|
||||
@@ -135,7 +135,7 @@ export const ZGetRetellLLMSchema = z
|
||||
begin_message: z.string().nullable().optional(),
|
||||
llm_id: z.string(),
|
||||
llm_websocket_url: z.string().optional(),
|
||||
inbound_dynamic_variables_webhook_url: z.string(),
|
||||
inbound_dynamic_variables_webhook_url: z.string().optional(),
|
||||
general_tools: z.array(
|
||||
z
|
||||
.object({
|
||||
|
||||
Reference in New Issue
Block a user