New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@foundationui/react-hooks

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@foundationui/react-hooks - npm Package Compare versions

Comparing version 0.0.9 to 0.0.10

2

dist/cjs/bundle.js

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

"use strict";var t=require("react");exports.useFoundationModel=function(e){var o=e.dev?"http://localhost:7777/v0":"https://api.foundation-ui.com/v0",n=t.useMemo((function(){return function(t){if(e.fetchModelOutput)return e.fetchModelOutput(t);var n={"Content-Type":"application/json"};return e.getJWT&&(n.Authorization="Bearer ".concat(e.getJWT())),fetch("".concat(o,"/model"),{method:"POST",mode:"cors",headers:n,body:JSON.stringify({model:e.model,user:e.user,safeMode:e.safeMode,input:t})}).then((function(t){return 200!==t.status&&console.error("Error getting completion"),t.json()})).catch((function(t){return console.error(t),null}))}}),[e.model,e.user,e.dev,e.safeMode,e.getJWT,e.fetchModelOutput]),r=t.useMemo((function(){return function(t){if(e.markOutput)return e.markOutput(t,{seen:!0});var n={"Content-Type":"application/json"};return e.getJWT&&(n.Authorization="Bearer ".concat(e.getJWT())),fetch("".concat(o,"/model"),{method:"PUT",mode:"cors",headers:n,body:JSON.stringify({outputSid:t,seen:!0})}).then((function(t){200!==t.status&&console.error("Couldn't update completion to seen")})).catch((function(t){return console.error(t)}))}}),[o,e.markOutput,e.getJWT]),u=t.useMemo((function(){return function(t){if(e.markOutput)return e.markOutput(t,{accepted:!0});var n={"Content-Type":"application/json"};return e.getJWT&&(n.Authorization="Bearer ".concat(e.getJWT())),fetch("".concat(o,"/model"),{method:"PUT",mode:"cors",headers:n,body:JSON.stringify({outputSid:t,accepted:!0})}).then((function(t){200!==t.status&&console.error("Couldn't update completion to accepted")})).catch((function(t){return console.error(t)}))}}),[o,e.markOutput,e.getJWT]);return{model:e.model,user:e.user,getCompletion:n,markCompletionSeen:r,markCompletionAccepted:u}};
"use strict";var t=require("react");exports.useFoundationModel=function(e){var o=e.dev?"http://localhost:7777/v0":e.stage?"https://api-stage.foundation-ui.com/v0":"https://api.foundation-ui.com/v0",n=t.useMemo((function(){return function(t){if(e.fetchModelOutput)return e.fetchModelOutput(t);var n={"Content-Type":"application/json"};return e.getJWT&&(n.Authorization="Bearer ".concat(e.getJWT())),fetch("".concat(o,"/model"),{method:"POST",mode:"cors",headers:n,body:JSON.stringify({model:e.model,user:e.user,safeMode:e.safeMode,input:t})}).then((function(t){return 200!==t.status&&console.error("Error getting completion"),t.json()})).catch((function(t){return console.error(t),null}))}}),[e.model,e.user,e.dev,e.safeMode,e.getJWT,e.fetchModelOutput]),r=t.useMemo((function(){return function(t){if(e.markOutput)return e.markOutput(t,{seen:!0});var n={"Content-Type":"application/json"};return e.getJWT&&(n.Authorization="Bearer ".concat(e.getJWT())),fetch("".concat(o,"/model"),{method:"PUT",mode:"cors",headers:n,body:JSON.stringify({outputSid:t,seen:!0})}).then((function(t){200!==t.status&&console.error("Couldn't update completion to seen")})).catch((function(t){return console.error(t)}))}}),[o,e.markOutput,e.getJWT]),u=t.useMemo((function(){return function(t){if(e.markOutput)return e.markOutput(t,{accepted:!0});var n={"Content-Type":"application/json"};return e.getJWT&&(n.Authorization="Bearer ".concat(e.getJWT())),fetch("".concat(o,"/model"),{method:"PUT",mode:"cors",headers:n,body:JSON.stringify({outputSid:t,accepted:!0})}).then((function(t){200!==t.status&&console.error("Couldn't update completion to accepted")})).catch((function(t){return console.error(t)}))}}),[o,e.markOutput,e.getJWT]);return{model:e.model,user:e.user,getCompletion:n,markCompletionSeen:r,markCompletionAccepted:u}};

@@ -6,2 +6,3 @@ import { ICompletionResponse } from './protocol';

dev?: boolean;
stage?: boolean;
safeMode?: boolean;

@@ -8,0 +9,0 @@ fetchModelOutput?: (input: any) => Promise<ICompletionResponse | null>;

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

import t from"react";function e(e){var o=e.dev?"http://localhost:7777/v0":"https://api.foundation-ui.com/v0",n=t.useMemo((function(){return function(t){if(e.fetchModelOutput)return e.fetchModelOutput(t);var n={"Content-Type":"application/json"};return e.getJWT&&(n.Authorization="Bearer ".concat(e.getJWT())),fetch("".concat(o,"/model"),{method:"POST",mode:"cors",headers:n,body:JSON.stringify({model:e.model,user:e.user,safeMode:e.safeMode,input:t})}).then((function(t){return 200!==t.status&&console.error("Error getting completion"),t.json()})).catch((function(t){return console.error(t),null}))}}),[e.model,e.user,e.dev,e.safeMode,e.getJWT,e.fetchModelOutput]),r=t.useMemo((function(){return function(t){if(e.markOutput)return e.markOutput(t,{seen:!0});var n={"Content-Type":"application/json"};return e.getJWT&&(n.Authorization="Bearer ".concat(e.getJWT())),fetch("".concat(o,"/model"),{method:"PUT",mode:"cors",headers:n,body:JSON.stringify({outputSid:t,seen:!0})}).then((function(t){200!==t.status&&console.error("Couldn't update completion to seen")})).catch((function(t){return console.error(t)}))}}),[o,e.markOutput,e.getJWT]),u=t.useMemo((function(){return function(t){if(e.markOutput)return e.markOutput(t,{accepted:!0});var n={"Content-Type":"application/json"};return e.getJWT&&(n.Authorization="Bearer ".concat(e.getJWT())),fetch("".concat(o,"/model"),{method:"PUT",mode:"cors",headers:n,body:JSON.stringify({outputSid:t,accepted:!0})}).then((function(t){200!==t.status&&console.error("Couldn't update completion to accepted")})).catch((function(t){return console.error(t)}))}}),[o,e.markOutput,e.getJWT]);return{model:e.model,user:e.user,getCompletion:n,markCompletionSeen:r,markCompletionAccepted:u}}export{e as useFoundationModel};
import t from"react";function e(e){var o=e.dev?"http://localhost:7777/v0":e.stage?"https://api-stage.foundation-ui.com/v0":"https://api.foundation-ui.com/v0",n=t.useMemo((function(){return function(t){if(e.fetchModelOutput)return e.fetchModelOutput(t);var n={"Content-Type":"application/json"};return e.getJWT&&(n.Authorization="Bearer ".concat(e.getJWT())),fetch("".concat(o,"/model"),{method:"POST",mode:"cors",headers:n,body:JSON.stringify({model:e.model,user:e.user,safeMode:e.safeMode,input:t})}).then((function(t){return 200!==t.status&&console.error("Error getting completion"),t.json()})).catch((function(t){return console.error(t),null}))}}),[e.model,e.user,e.dev,e.safeMode,e.getJWT,e.fetchModelOutput]),r=t.useMemo((function(){return function(t){if(e.markOutput)return e.markOutput(t,{seen:!0});var n={"Content-Type":"application/json"};return e.getJWT&&(n.Authorization="Bearer ".concat(e.getJWT())),fetch("".concat(o,"/model"),{method:"PUT",mode:"cors",headers:n,body:JSON.stringify({outputSid:t,seen:!0})}).then((function(t){200!==t.status&&console.error("Couldn't update completion to seen")})).catch((function(t){return console.error(t)}))}}),[o,e.markOutput,e.getJWT]),u=t.useMemo((function(){return function(t){if(e.markOutput)return e.markOutput(t,{accepted:!0});var n={"Content-Type":"application/json"};return e.getJWT&&(n.Authorization="Bearer ".concat(e.getJWT())),fetch("".concat(o,"/model"),{method:"PUT",mode:"cors",headers:n,body:JSON.stringify({outputSid:t,accepted:!0})}).then((function(t){200!==t.status&&console.error("Couldn't update completion to accepted")})).catch((function(t){return console.error(t)}))}}),[o,e.markOutput,e.getJWT]);return{model:e.model,user:e.user,getCompletion:n,markCompletionSeen:r,markCompletionAccepted:u}}export{e as useFoundationModel};

@@ -6,2 +6,3 @@ import { ICompletionResponse } from './protocol';

dev?: boolean;
stage?: boolean;
safeMode?: boolean;

@@ -8,0 +9,0 @@ fetchModelOutput?: (input: any) => Promise<ICompletionResponse | null>;

@@ -14,2 +14,3 @@ /**

dev?: boolean;
stage?: boolean;
safeMode?: boolean;

@@ -16,0 +17,0 @@ fetchModelOutput?: (input: any) => Promise<ICompletionResponse | null>;

{
"name": "@foundationui/react-hooks",
"version": "0.0.9",
"version": "0.0.10",
"description": "Use a foundation model in your app. It gets smarter the more your users use it.",

@@ -5,0 +5,0 @@ "type": "module",

Sorry, the diff of this file is not supported yet

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