Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nlux/openai-react

Package Overview
Dependencies
Maintainers
1
Versions
202
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nlux/openai-react - npm Package Compare versions

Comparing version 2.2.11-beta to 2.2.12-beta

2

cjs/openai-react.js

@@ -1,1 +0,1 @@

"use strict";var e=require("@nlux/openai"),t=require("react"),s=Object.defineProperty,r=(e,t,r)=>((e,t,r)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class a extends Error{constructor(e={}){super(e.message),r(this,"exceptionId"),r(this,"message"),r(this,"source"),r(this,"type"),this.message=e.message??"",this.source=e.source,this.type=this.constructor.name,this.exceptionId=e.exceptionId}}class o extends a{}const i="hooks/getAdapterBuilder",n=t=>{const{apiKey:s,dataTransferMode:r,systemMessage:a,model:n}=t||{};if(r&&"stream"!==r&&"fetch"!==r)throw new o({source:i,message:"Data transfer mode not supported"});if(!s)throw new o({source:i,message:"API key is required"});let c=e.createUnsafeChatAdapter().withApiKey(s);return void 0!==n&&(c=c.withModel(n)),r&&(c=c.withDataTransferMode(r)),a&&(c=c.withSystemMessage(a)),c};Object.defineProperty(exports,"createUnsafeChatAdapter",{enumerable:!0,get:function(){return e.createUnsafeChatAdapter}}),exports.useUnsafeChatAdapter=e=>{const[s,r]=t.useState(!1),[a,o]=t.useState(n(e).create()),{apiKey:i,dataTransferMode:c,systemMessage:u,model:d}=e||{};return t.useEffect((()=>{if(!s)return void r(!0);const t=n(e).create();o(t)}),[i,c,u,d]),a};
"use strict";var e=require("@nlux/openai"),t=require("react"),s=Object.defineProperty,r=(e,t,r)=>((e,t,r)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class a extends Error{constructor(e={}){super(e.message),r(this,"exceptionId"),r(this,"message"),r(this,"source"),r(this,"type"),this.message=e.message??"",this.source=e.source,this.type=this.constructor.name,this.exceptionId=e.exceptionId}}class o extends a{}const i="hooks/getAdapterBuilder",n=t=>{const{apiKey:s,dataTransferMode:r,systemMessage:a,model:n}=t||{};if(r&&"stream"!==r&&"batch"!==r)throw new o({source:i,message:"Data transfer mode not supported"});if(!s)throw new o({source:i,message:"API key is required"});let c=e.createUnsafeChatAdapter().withApiKey(s);return void 0!==n&&(c=c.withModel(n)),r&&(c=c.withDataTransferMode(r)),a&&(c=c.withSystemMessage(a)),c};Object.defineProperty(exports,"createUnsafeChatAdapter",{enumerable:!0,get:function(){return e.createUnsafeChatAdapter}}),exports.useUnsafeChatAdapter=e=>{const[s,r]=t.useState(!1),[a,o]=t.useState(n(e).create()),{apiKey:i,dataTransferMode:c,systemMessage:u,model:d}=e||{};return t.useEffect((()=>{if(!s)return void r(!0);const t=n(e).create();o(t)}),[i,c,u,d]),a};

@@ -1,1 +0,1 @@

import{createUnsafeChatAdapter as e}from"@nlux/openai";export{createUnsafeChatAdapter}from"@nlux/openai";import{useState as t,useEffect as s}from"react";var r=Object.defineProperty,o=(e,t,s)=>((e,t,s)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);class a extends Error{constructor(e={}){super(e.message),o(this,"exceptionId"),o(this,"message"),o(this,"source"),o(this,"type"),this.message=e.message??"",this.source=e.source,this.type=this.constructor.name,this.exceptionId=e.exceptionId}}class i extends a{}const n="hooks/getAdapterBuilder",c=t=>{const{apiKey:s,dataTransferMode:r,systemMessage:o,model:a}=t||{};if(r&&"stream"!==r&&"fetch"!==r)throw new i({source:n,message:"Data transfer mode not supported"});if(!s)throw new i({source:n,message:"API key is required"});let c=e().withApiKey(s);return void 0!==a&&(c=c.withModel(a)),r&&(c=c.withDataTransferMode(r)),o&&(c=c.withSystemMessage(o)),c},d=e=>{const[r,o]=t(!1),[a,i]=t(c(e).create()),{apiKey:n,dataTransferMode:d,systemMessage:m,model:p}=e||{};return s((()=>{if(!r)return void o(!0);const t=c(e).create();i(t)}),[n,d,m,p]),a};export{d as useUnsafeChatAdapter};
import{createUnsafeChatAdapter as e}from"@nlux/openai";export{createUnsafeChatAdapter}from"@nlux/openai";import{useState as t,useEffect as s}from"react";var r=Object.defineProperty,o=(e,t,s)=>((e,t,s)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);class a extends Error{constructor(e={}){super(e.message),o(this,"exceptionId"),o(this,"message"),o(this,"source"),o(this,"type"),this.message=e.message??"",this.source=e.source,this.type=this.constructor.name,this.exceptionId=e.exceptionId}}class i extends a{}const n="hooks/getAdapterBuilder",c=t=>{const{apiKey:s,dataTransferMode:r,systemMessage:o,model:a}=t||{};if(r&&"stream"!==r&&"batch"!==r)throw new i({source:n,message:"Data transfer mode not supported"});if(!s)throw new i({source:n,message:"API key is required"});let c=e().withApiKey(s);return void 0!==a&&(c=c.withModel(a)),r&&(c=c.withDataTransferMode(r)),o&&(c=c.withSystemMessage(o)),c},d=e=>{const[r,o]=t(!1),[a,i]=t(c(e).create()),{apiKey:n,dataTransferMode:d,systemMessage:m,model:p}=e||{};return s((()=>{if(!r)return void o(!0);const t=c(e).create();i(t)}),[n,d,m,p]),a};export{d as useUnsafeChatAdapter};
{
"name": "@nlux/openai-react",
"version": "2.2.11-beta",
"version": "2.2.12-beta",
"description": "The OpenAI adapters for nlux React, the React JS library for building conversational AI interfaces.",

@@ -62,6 +62,6 @@ "keywords": [

"dependencies": {
"@nlux/openai": "2.2.11-beta"
"@nlux/openai": "2.2.12-beta"
},
"peerDependencies": {
"@nlux/react": "2.2.11-beta",
"@nlux/react": "2.2.12-beta",
"react": "^18.3.1"

@@ -68,0 +68,0 @@ },

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@nlux/openai"),require("react")):"function"==typeof define&&define.amd?define(["exports","@nlux/openai","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@nlux/openai-react"]={},e.openai,e.react)}(this,(function(e,t,s){"use strict";var r=Object.defineProperty,a=(e,t,s)=>((e,t,s)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);class o extends Error{constructor(e={}){super(e.message),a(this,"exceptionId"),a(this,"message"),a(this,"source"),a(this,"type"),this.message=e.message??"",this.source=e.source,this.type=this.constructor.name,this.exceptionId=e.exceptionId}}class n extends o{}const i="hooks/getAdapterBuilder",c=e=>{const{apiKey:s,dataTransferMode:r,systemMessage:a,model:o}=e||{};if(r&&"stream"!==r&&"fetch"!==r)throw new n({source:i,message:"Data transfer mode not supported"});if(!s)throw new n({source:i,message:"API key is required"});let c=t.createUnsafeChatAdapter().withApiKey(s);return void 0!==o&&(c=c.withModel(o)),r&&(c=c.withDataTransferMode(r)),a&&(c=c.withSystemMessage(a)),c};Object.defineProperty(e,"createUnsafeChatAdapter",{enumerable:!0,get:function(){return t.createUnsafeChatAdapter}}),e.useUnsafeChatAdapter=e=>{const[t,r]=s.useState(!1),[a,o]=s.useState(c(e).create()),{apiKey:n,dataTransferMode:i,systemMessage:u,model:d}=e||{};return s.useEffect((()=>{if(!t)return void r(!0);const s=c(e).create();o(s)}),[n,i,u,d]),a}}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@nlux/openai"),require("react")):"function"==typeof define&&define.amd?define(["exports","@nlux/openai","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@nlux/openai-react"]={},e.openai,e.react)}(this,(function(e,t,s){"use strict";var r=Object.defineProperty,a=(e,t,s)=>((e,t,s)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);class o extends Error{constructor(e={}){super(e.message),a(this,"exceptionId"),a(this,"message"),a(this,"source"),a(this,"type"),this.message=e.message??"",this.source=e.source,this.type=this.constructor.name,this.exceptionId=e.exceptionId}}class n extends o{}const i="hooks/getAdapterBuilder",c=e=>{const{apiKey:s,dataTransferMode:r,systemMessage:a,model:o}=e||{};if(r&&"stream"!==r&&"batch"!==r)throw new n({source:i,message:"Data transfer mode not supported"});if(!s)throw new n({source:i,message:"API key is required"});let c=t.createUnsafeChatAdapter().withApiKey(s);return void 0!==o&&(c=c.withModel(o)),r&&(c=c.withDataTransferMode(r)),a&&(c=c.withSystemMessage(a)),c};Object.defineProperty(e,"createUnsafeChatAdapter",{enumerable:!0,get:function(){return t.createUnsafeChatAdapter}}),e.useUnsafeChatAdapter=e=>{const[t,r]=s.useState(!1),[a,o]=s.useState(c(e).create()),{apiKey:n,dataTransferMode:i,systemMessage:u,model:d}=e||{};return s.useEffect((()=>{if(!t)return void r(!0);const s=c(e).create();o(s)}),[n,i,u,d]),a}}));
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc