Support openai library tool (#20293)

Support chatgpt library tool
This commit is contained in:
lt-oai
2026-05-08 15:56:13 -07:00
committed by GitHub
parent 1b86906fa1
commit 80a408e201

View File

@@ -11,6 +11,7 @@ const DISALLOWED_CONNECTOR_IDS: &[&str] = &[
];
const FIRST_PARTY_CHAT_DISALLOWED_CONNECTOR_IDS: &[&str] =
&["connector_0f9c9d4592e54d0a9a12b3f44a1e2010"];
const ALLOWED_OPENAI_CONNECTOR_IDS: &[&str] = &["connector_openai_library"];
const DISALLOWED_CONNECTOR_PREFIX: &str = "connector_openai_";
pub fn is_connector_id_allowed(connector_id: &str) -> bool {
@@ -24,6 +25,10 @@ fn is_connector_id_allowed_for_originator(connector_id: &str, originator_value:
DISALLOWED_CONNECTOR_IDS
};
if ALLOWED_OPENAI_CONNECTOR_IDS.contains(&connector_id) {
return true;
}
!connector_id.starts_with(DISALLOWED_CONNECTOR_PREFIX)
&& !disallowed_connector_ids.contains(&connector_id)
}