{"id":17381734,"url":"https://github.com/superfaceai/hubapi-example-langchain","last_synced_at":"2025-07-24T14:31:48.084Z","repository":{"id":231553332,"uuid":"782049435","full_name":"superfaceai/hubapi-example-langchain","owner":"superfaceai","description":"An example of using Superface's Hub API with LangChain, OpenAI and Node.js","archived":false,"fork":false,"pushed_at":"2024-07-09T08:42:03.000Z","size":15,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-16T07:04:44.487Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/superfaceai.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-04T14:41:04.000Z","updated_at":"2024-10-04T18:24:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"c9f0644d-7001-41c9-b549-bc80bfa6c236","html_url":"https://github.com/superfaceai/hubapi-example-langchain","commit_stats":null,"previous_names":["superfaceai/hubapi-example-langchain"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superfaceai%2Fhubapi-example-langchain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superfaceai%2Fhubapi-example-langchain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superfaceai%2Fhubapi-example-langchain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superfaceai%2Fhubapi-example-langchain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/superfaceai","download_url":"https://codeload.github.com/superfaceai/hubapi-example-langchain/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227448650,"owners_count":17777325,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-16T07:01:36.173Z","updated_at":"2024-11-30T23:11:59.880Z","avatar_url":"https://github.com/superfaceai.png","language":"JavaScript","readme":"# Hub API - LangChain, OpenAI and Node.js Example\n\nIn this example repository we will focus on building a simple agent that can consume and use the functions definitions provided by Superface using the LangChain.js library, OpenAI and Node.js.\n\n## Run this example\n\nClone the repository, and run:\n\n```\nnpm install\n```\n\nThis will install the LangChain dependencies, as well as Axios for making HTTP requests to the Hub API.\n\n### Add API Keys\n\nAfter everything is installed you will need to add two API keys in `src/index.js`:\n\n```\nconst OPENAI_API_KEY = \"\u003cyour-openai-api-key\u003e\";\nconst SUPERFACE_AUTH_TOKEN = \"\u003cyour-superface-auth-token\u003e\";\n```\n\n### Change the prompt\n\nBy default, there is a prompt that will make two calls to Superface's Hub API to get the weather details for two different cities. You can edit this to add more if you like, or change the cities to those nearer to you.\n\n```\nconst PROMPT = \"What's the weather like in Prague and in Kosice?\";\n```\n\n### Run it\n\n```\nnpm run example\n```\n\nAfter a moment you will see responses from the Hub API, followed by the final result. Something like this:\n\n```\nSUPERFACE RESPONSE: {\"status\":\"success\",\"assistant_hint\":\"Format the result in 'result' field to the user. If the user asked for a specific format, respect it\",\"result\":{\"description\":\"Partly cloudy\",\"feelsLike\":17,\"temperature\":17}}\nSUPERFACE RESPONSE: {\"status\":\"success\",\"assistant_hint\":\"Format the result in 'result' field to the user. If the user asked for a specific format, respect it\",\"result\":{\"description\":\"Partly cloudy\",\"feelsLike\":15,\"temperature\":15}}\nThe current weather in Prague is partly cloudy with a temperature of 15°C, and in Kosice, it is also partly cloudy with a temperature of 17°C.\n```\n\n## For more information\n\nThe full breakdown can be found here: [https://superface.ai/docs/api/examples/langchain](https://superface.ai/docs/api/examples/langchain)\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperfaceai%2Fhubapi-example-langchain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuperfaceai%2Fhubapi-example-langchain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperfaceai%2Fhubapi-example-langchain/lists"}