Skip to content

Commit

Permalink
fix: remove leftovers
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonrybczak committed Jul 24, 2024
1 parent 9295c10 commit e27aef4
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
import { NativeEventEmitter, NativeModules, Platform } from 'react-native';
import {
UnsupportedFunctionalityError,
type LanguageModelV1,
type LanguageModelV1CallOptions,
type LanguageModelV1CallWarning,
type LanguageModelV1FinishReason,
type LanguageModelV1FunctionToolCall,
type LanguageModelV1ImagePart,
type LanguageModelV1Prompt,
type LanguageModelV1StreamPart,
type LanguageModelV1TextPart,
type LanguageModelV1ToolCallPart,
type LanguageModelV1ToolResultPart,
} from '@ai-sdk/provider';
import './polyfills';
import { ReadableStream } from 'web-streams-polyfill/ponyfill';
Expand Down Expand Up @@ -49,26 +43,6 @@ export interface Model {
modelLib: string;
}

function getStringContent(
content:
| string
| (LanguageModelV1TextPart | LanguageModelV1ImagePart)[]
| (LanguageModelV1TextPart | LanguageModelV1ToolCallPart)[]
| LanguageModelV1ToolResultPart[]
): string {
if (typeof content === 'string') {
return content.trim();
} else if (Array.isArray(content) && content.length > 0) {
const [first] = content;
if (first.type !== 'text') {
throw new UnsupportedFunctionalityError({ functionality: 'toolCall' });
}
return first.text.trim();
} else {
return '';
}
}

class AiModel implements LanguageModelV1 {
readonly specificationVersion = 'v1';
readonly defaultObjectGenerationMode = 'json';
Expand Down Expand Up @@ -106,7 +80,6 @@ class AiModel implements LanguageModelV1 {
const model = await this.getModel();
console.log({ model });

// TODO: add proper types
const message =
options.prompt[options.prompt.length - 1]!.content[0]!.text!;
console.log({ message });
Expand Down

0 comments on commit e27aef4

Please sign in to comment.