@agentica/chat 0.19.1 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1 +1,165 @@
1
- # WrtnLabs POC Agent Chat Applications
1
+ # Agentica, AI Function Calling Framework
2
+
3
+ <!-- https://github.com/user-attachments/assets/5326cc59-5129-470d-abcb-c3f458b5c488 -->
4
+
5
+ ![Logo](https://wrtnlabs.io/agentica/og.jpg?refresh)
6
+
7
+ [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/wrtnlabs/agentica/blob/master/LICENSE)
8
+ [![NPM Version](https://img.shields.io/npm/v/@agentica/core.svg)](https://www.npmjs.com/package/@agentica/core)
9
+ [![NPM Downloads](https://img.shields.io/npm/dm/@agentica/core.svg)](https://www.npmjs.com/package/@agentica/core)
10
+ [![Build Status](https://github.com/wrtnlabs/agentica/workflows/build/badge.svg)](https://github.com/wrtnlabs/agentica/actions?query=workflow%3Abuild)
11
+ [![Guide Documents](https://img.shields.io/badge/Guide-Documents-forestgreen)](https://wrtnlabs.io/agentica/)
12
+ [![Discord Badge](https://dcbadge.limes.pink/api/server/https://discord.gg/aMhRmzkqCx?style=flat)](https://discord.gg/aMhRmzkqCx)
13
+
14
+ Agentic AI framework specialized in AI Function Calling.
15
+
16
+ Don't be afraid of AI agent development. Just list functions from three protocols below. This is everything you should do for AI agent development.
17
+
18
+ - TypeScript Class
19
+ - Swagger/OpenAPI Document
20
+ - MCP (Model Context Protocol) Server
21
+
22
+ Wanna make an e-commerce agent? Bring in e-commerce functions. Need a newspaper agent? Get API functions from the newspaper company. Just prepare any functions that you need, then it becomes an AI agent.
23
+
24
+ Are you a TypeScript developer? Then you're already an AI developer. Familiar with backend development? You're already well-versed in AI development. Anyone who can make functions can make AI agents.
25
+
26
+ <!-- eslint-skip -->
27
+
28
+ ```typescript
29
+ import { Agentica, assertHttpLlmApplication } from "@agentica/core";
30
+ import OpenAI from "openai";
31
+ import typia from "typia";
32
+
33
+ import { MobileFileSystem } from "./services/MobileFileSystem";
34
+
35
+ const agent = new Agentica({
36
+ vendor: {
37
+ api: new OpenAI({ apiKey: "********" }),
38
+ model: "gpt-4o-mini",
39
+ },
40
+ controllers: [
41
+ // functions from TypeScript class
42
+ {
43
+ protocol: "http",
44
+ application: typia.llm.application<MobileFileSystem, "chatgpt">(),
45
+ execute: new MobileFileSystem(),
46
+ },
47
+ // functions from Swagger/OpenAPI
48
+ {
49
+ protocol: "http",
50
+ application: assertHttpLlmApplication({
51
+ model: "chatgpt",
52
+ document: await fetch(
53
+ "https://shopping-be.wrtn.ai/editor/swagger.json",
54
+ ).then(r => r.json()),
55
+ }),
56
+ connection: {
57
+ host: "https://shopping-be.wrtn.ai",
58
+ headers: { Authorization: "Bearer ********" },
59
+ },
60
+ },
61
+ ],
62
+ });
63
+ await agent.conversate("I wanna buy MacBook Pro");
64
+ ```
65
+
66
+ ## 📦 Setup
67
+
68
+ ```bash
69
+ $ npx agentica start <directory>
70
+
71
+ ----------------------------------------
72
+ Agentica Setup Wizard
73
+ ----------------------------------------
74
+ ? Package Manager (use arrow keys)
75
+ > npm
76
+ pnpm
77
+ yarn (berry is not supported)
78
+ ? Project Type
79
+ NodeJS Agent Server
80
+ > NestJS Agent Server
81
+ React Client Application
82
+ Standalone Application
83
+ ? Embedded Controllers (multi-selectable)
84
+ (none)
85
+ Google Calendar
86
+ Google News
87
+ > Github
88
+ Reddit
89
+ Slack
90
+ ...
91
+ ```
92
+
93
+ The setup wizard helps you create a new project tailored to your needs.
94
+
95
+ For reference, when selecting a project type, any option other than "Standalone Application" will implement the [WebSocket Protocol](https://wrtnlabs.io/agentica/docs/websocket/) for client-server communication.
96
+
97
+ For comprehensive setup instructions, visit our [Getting Started](https://wrtnlabs.io/agentica/docs/) guide.
98
+
99
+ ## 💻 Playground
100
+
101
+ Experience Agentica firsthand through our [interactive playground](https://wrtnlabs.io/agentica/playground) before installing.
102
+
103
+ Our demonstrations showcase the power and simplicity of Agentica's function calling capabilities across different integration methods.
104
+
105
+ - [TypeScript Class](https://wrtnlabs.io/agentica/playground/bbs)
106
+ - [Swagger/OpenAPI Document](https://wrtnlabs.io/agentica/playground/swagger)
107
+ - [Enterprise E-commerce Agent](https://wrtnlabs.io/agentica/playground/shopping)
108
+
109
+ <!--
110
+ @todo this section would be changed after making tutorial playground
111
+ -->
112
+
113
+ ## 📚 Documentation Resources
114
+
115
+ Find comprehensive resources at our [official website](https://wrtnlabs.io/agentica).
116
+
117
+ - [Home](https://wrtnlabs.io/agentica)
118
+ - [Guide Documents](https://wrtnlabs.io/agentica/docs)
119
+ - [Tutorial](https://wrtnlabs.io/agentica/tutorial)
120
+ - [API Documents](https://wrtnlabs.io/agentica/api)
121
+ - [Youtube](https://www.youtube.com/@wrtnlabs)
122
+ - [Paper](https://wrtnlabs.io/agentica/paper)
123
+
124
+ ## 🌟 Why Agentica?
125
+
126
+ ```mermaid
127
+ flowchart
128
+ subgraph "JSON Schema Specification"
129
+ schemav4("JSON Schema v4 ~ v7") --upgrades--> emended[["OpenAPI v3.1 (emended)"]]
130
+ schema2910("JSON Schema 2019-03") --upgrades--> emended
131
+ schema2020("JSON Schema 2020-12") --emends--> emended
132
+ end
133
+ subgraph "Agentica"
134
+ emended --"Artificial Intelligence"--> fc{{"AI Function Calling"}}
135
+ fc --"OpenAI"--> chatgpt("ChatGPT")
136
+ fc --"Google"--> gemini("Gemini")
137
+ fc --"Anthropic"--> claude("Claude")
138
+ fc --"High-Flyer"--> deepseek("DeepSeek")
139
+ fc --"Meta"--> llama("Llama")
140
+ chatgpt --"3.1"--> custom(["Custom JSON Schema"])
141
+ gemini --"3.0"--> custom(["Custom JSON Schema"])
142
+ claude --"3.1"--> standard(["Standard JSON Schema"])
143
+ deepseek --"3.1"--> standard
144
+ llama --"3.1"--> standard
145
+ end
146
+ ```
147
+
148
+ Agentica enhances AI function calling by the following strategies:
149
+
150
+ - [**Compiler Driven Development**](https://wrtnlabs.io/agentica/docs/concepts/compiler-driven-development): constructs function calling schema automatically by compiler skills without hand-writing.
151
+ - [**JSON Schema Conversion**](https://wrtnlabs.io/agentica/docs/core/vendor/#schema-specification): automatically handles specification differences between LLM vendors, ensuring seamless integration regardless of your chosen AI model.
152
+ - [**Validation Feedback**](https://wrtnlabs.io/agentica/docs/concepts/function-calling#validation-feedback): detects and corrects AI mistakes in argument composition, dramatically reducing errors and improving reliability.
153
+ - [**Selector Agent**](https://wrtnlabs.io/agentica/docs/concepts/function-calling#orchestration-strategy): filtering candidate functions to minimize context usage, optimize performance, and reduce token consumption.
154
+
155
+ Thanks to these innovations, Agentica makes AI function calling easier, safer, and more accurate than before. Development becomes more intuitive since you only need to prepare functions relevant to your specific use case, and scaling your agent's capabilities is as simple as adding or removing functions.
156
+
157
+ In 2023, when OpenAI announced function calling, many predicted that function calling-driven AI development would become the mainstream. However, in reality, due to the difficulty and instability of function calling, the trend in AI development became agent workflow. Agent workflow, which is inflexible and must be created for specific purposes, has conquered the AI agent ecosystem.
158
+ By the way, as Agentica has resolved the difficulty and instability problems of function calling, the time has come to embrace function-driven AI development once again.
159
+
160
+ | Type | Workflow | Vanilla Function Calling | Agentica Function Calling |
161
+ | ----------- | ------------- | ------------------------ | ------------------------- |
162
+ | Purpose | ❌ Specific | 🟢 General | 🟢 General |
163
+ | Difficulty | ❌ Difficult | ❌ Difficult | 🟢 Easy |
164
+ | Stability | 🟢 Stable | ❌ Unstable | 🟢 Stable |
165
+ | Flexibility | ❌ Inflexible | 🟢 Flexible | 🟢 Flexible |