Skip to content

Commit fc7770b

Browse files
committed
feat: updated the protos and implimenation
1 parent b2efb56 commit fc7770b

4 files changed

Lines changed: 9 additions & 100 deletions

File tree

src/__tests__/configs/index.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ import {
1616
describe('configs', () => {
1717
describe('Production API endpoints', () => {
1818
it('should have correct ASSISTANT_API endpoint', () => {
19-
expect(ASSISTANT_API).toBe('workflow-01.rapida.ai');
19+
expect(ASSISTANT_API).toBe('assistant-01.in.rapida.ai');
2020
});
2121

2222
it('should have correct ENDPOINT_API endpoint', () => {
23-
expect(ENDPOINT_API).toBe('endpoint-01.rapida.ai');
23+
expect(ENDPOINT_API).toBe('endpoint-01.in.rapida.ai');
2424
});
2525

2626
it('should have correct WEB_API endpoint', () => {
27-
expect(WEB_API).toBe('web-01.rapida.ai');
27+
expect(WEB_API).toBe('api-01.in.rapida.ai');
2828
});
2929
});
3030

src/__tests__/connections/connection-config.test.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,6 @@ describe('ConnectionConfig', () => {
169169
expect(config.deploymentClient).toBeDefined();
170170
});
171171

172-
it('should return marketplaceClient', () => {
173-
expect(config.marketplaceClient).toBeDefined();
174-
});
175-
176172
it('should return documentClient', () => {
177173
expect(config.documentClient).toBeDefined();
178174
});
@@ -201,10 +197,6 @@ describe('ConnectionConfig', () => {
201197
expect(config.connectClient).toBeDefined();
202198
});
203199

204-
it('should return providerClient', () => {
205-
expect(config.providerClient).toBeDefined();
206-
});
207-
208200
it('should return authenticationClient', () => {
209201
expect(config.authenticationClient).toBeDefined();
210202
});

src/__tests__/utils/rapida_content.test.ts

Lines changed: 6 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import {
2121
toStreamAudioContent,
2222
ToContentText,
2323
} from '../../utils/rapida_content';
24-
import { Content } from '../../clients/protos/common_pb';
2524

2625
describe('rapida_content', () => {
2726
describe('ResponseContentType enum', () => {
@@ -111,101 +110,20 @@ describe('rapida_content', () => {
111110
});
112111

113112
describe('toTextContent', () => {
114-
it('should create text content with default format', () => {
115-
const content = toTextContent('Hello, World!');
116-
117-
expect(content).toBeInstanceOf(Content);
118-
expect(content.getContenttype()).toBe('text');
119-
expect(content.getContentformat()).toBe('raw');
120-
});
121-
122-
it('should create text content with specified format', () => {
123-
const content = toTextContent('Hello, World!', 'word');
124-
125-
expect(content).toBeInstanceOf(Content);
126-
expect(content.getContenttype()).toBe('text');
127-
expect(content.getContentformat()).toBe('word');
128-
});
129-
130-
it('should encode string content as Uint8Array', () => {
131-
const text = 'Test message';
132-
const content = toTextContent(text);
133-
134-
const decoded = new TextDecoder().decode(content.getContent() as Uint8Array);
135-
expect(decoded).toBe(text);
136-
});
137-
138-
it('should handle empty string', () => {
139-
const content = toTextContent('');
140-
141-
expect(content).toBeInstanceOf(Content);
142-
const decoded = new TextDecoder().decode(content.getContent() as Uint8Array);
143-
expect(decoded).toBe('');
144-
});
145-
146-
it('should handle unicode characters', () => {
147-
const text = 'こんにちは世界 🌍';
148-
const content = toTextContent(text);
149-
150-
const decoded = new TextDecoder().decode(content.getContent() as Uint8Array);
151-
expect(decoded).toBe(text);
113+
it('should throw not implemented error', () => {
114+
expect(() => toTextContent('Hello, World!')).toThrow('toTextContent not implemented');
152115
});
153116
});
154117

155118
describe('toStreamAudioContent', () => {
156-
it('should create audio content with chunk format from Uint8Array', () => {
157-
const audioData = new Uint8Array([1, 2, 3, 4, 5]);
158-
const content = toStreamAudioContent(audioData);
159-
160-
expect(content).toBeInstanceOf(Content);
161-
expect(content.getContenttype()).toBe('audio');
162-
expect(content.getContentformat()).toBe('chunk');
163-
});
164-
165-
it('should create audio content from string', () => {
166-
const audioData = 'audio-data-string';
167-
const content = toStreamAudioContent(audioData);
168-
169-
expect(content).toBeInstanceOf(Content);
170-
expect(content.getContenttype()).toBe('audio');
171-
expect(content.getContentformat()).toBe('chunk');
119+
it('should throw not implemented error', () => {
120+
expect(() => toStreamAudioContent(new Uint8Array([1, 2, 3]))).toThrow('toStreamAudioContent not implemented');
172121
});
173122
});
174123

175124
describe('ToContentText', () => {
176-
it('should return empty string for undefined content', () => {
177-
expect(ToContentText(undefined)).toBe('');
178-
});
179-
180-
it('should return empty string for empty array', () => {
181-
expect(ToContentText([])).toBe('');
182-
});
183-
184-
it('should extract text from text content array', () => {
185-
const content1 = toTextContent('Hello');
186-
const content2 = toTextContent('World');
187-
188-
const result = ToContentText([content1, content2]);
189-
190-
expect(result).toBe('Hello World');
191-
});
192-
193-
it('should filter out non-text content', () => {
194-
const textContent = toTextContent('Hello');
195-
const audioContent = toStreamAudioContent(new Uint8Array([1, 2, 3]));
196-
197-
const result = ToContentText([textContent, audioContent]);
198-
199-
expect(result).toBe('Hello');
200-
});
201-
202-
it('should handle content with decoding errors gracefully', () => {
203-
const content = new Content();
204-
content.setContenttype('text');
205-
content.setContent('invalid' as any); // Invalid content that might cause decode error
206-
207-
// Should not throw, but return appropriate result
208-
expect(() => ToContentText([content])).not.toThrow();
125+
it('should throw not implemented error', () => {
126+
expect(() => ToContentText([])).toThrow('ToContentText not implemented');
209127
});
210128
});
211129
});

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ export {
229229
SystemMessage,
230230
UserMessage,
231231
ToolMessage,
232-
Telemetry,
233232
AssistantConversationRecording,
234233
AssistantConversationTelephonyEvent,
235234
} from "@/rapida/clients/protos/common_pb";

0 commit comments

Comments
 (0)