pub struct ChatGptAdapter {
pub widget_meta: Option<WidgetMeta>,
}Available on crate feature
mcp-apps and non-WebAssembly only.Expand description
Adapter for ChatGPT Apps (OpenAI Apps SDK).
Transforms resources to use text/html;profile=mcp-app MIME type and
injects the window.openai bridge for widget communication.
Fields§
§widget_meta: Option<WidgetMeta>Optional widget metadata for ChatGPT.
Implementations§
Source§impl ChatGptAdapter
impl ChatGptAdapter
Sourcepub fn with_widget_meta(self, meta: WidgetMeta) -> Self
pub fn with_widget_meta(self, meta: WidgetMeta) -> Self
Set widget metadata for this adapter.
Trait Implementations§
Source§impl Clone for ChatGptAdapter
impl Clone for ChatGptAdapter
Source§fn clone(&self) -> ChatGptAdapter
fn clone(&self) -> ChatGptAdapter
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChatGptAdapter
impl Debug for ChatGptAdapter
Source§impl Default for ChatGptAdapter
impl Default for ChatGptAdapter
Source§fn default() -> ChatGptAdapter
fn default() -> ChatGptAdapter
Returns the “default value” for a type. Read more
Source§impl UIAdapter for ChatGptAdapter
impl UIAdapter for ChatGptAdapter
Source§fn mime_type(&self) -> ExtendedUIMimeType
fn mime_type(&self) -> ExtendedUIMimeType
Get the MIME type this adapter produces.
Source§fn transform(&self, uri: &str, name: &str, html: &str) -> TransformedResource
fn transform(&self, uri: &str, name: &str, html: &str) -> TransformedResource
Transform HTML content for this host platform. Read more
Source§fn inject_bridge(&self, html: &str) -> String
fn inject_bridge(&self, html: &str) -> String
Inject platform-specific communication bridge into HTML content. Read more
Source§fn required_csp(&self) -> Option<WidgetCSP>
fn required_csp(&self) -> Option<WidgetCSP>
Get CSP headers required by this platform.
Auto Trait Implementations§
impl Freeze for ChatGptAdapter
impl RefUnwindSafe for ChatGptAdapter
impl Send for ChatGptAdapter
impl Sync for ChatGptAdapter
impl Unpin for ChatGptAdapter
impl UnsafeUnpin for ChatGptAdapter
impl UnwindSafe for ChatGptAdapter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more