File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,12 +96,6 @@ await sgai.search("What is the capital of France?", {
9696});
9797```
9898
99- ### schema
100-
101- ``` ts
102- await sgai .schema (" A product with name and price" );
103- ```
104-
10599### credits
106100
107101``` ts
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import { request } from "./http.js";
22import type {
33 ApiCrawlOptions ,
44 ApiExtractOptions ,
5- ApiGenerateSchemaOptions ,
65 ApiHistoryFilterInput ,
76 ApiMonitorCreateInput ,
87 ApiScrapeOptions ,
@@ -64,20 +63,6 @@ export function scrapegraphai(config: ClientConfig) {
6463 ) ;
6564 } ,
6665
67- async schema (
68- prompt : string ,
69- schemaOptions ?: ApiGenerateSchemaOptions ,
70- requestOptions ?: RequestOptions ,
71- ) {
72- return request (
73- "POST" ,
74- buildUrl ( "/v2/schema" ) ,
75- key ,
76- { prompt, ...schemaOptions } ,
77- mergeRequestOptions ( requestOptions ) ,
78- ) ;
79- } ,
80-
8166 async credits ( requestOptions ?: RequestOptions ) {
8267 return request (
8368 "GET" ,
Original file line number Diff line number Diff line change @@ -6,8 +6,6 @@ export type {
66 ApiExtractOptions ,
77 ApiExtractRequestBase ,
88 ApiFetchConfig ,
9- ApiGenerateSchemaOptions ,
10- ApiGenerateSchemaRequest ,
119 ApiHistoryFilterInput ,
1210 ApiHistoryService ,
1311 ApiHtmlMode ,
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ import * as url from "./url.js";
55export const apiServiceEnumSchema = z . enum ( [
66 "scrape" ,
77 "extract" ,
8- "schema" ,
98 "search" ,
109 "monitor" ,
1110 "crawl" ,
@@ -181,12 +180,6 @@ export const apiExtractRequestBaseSchema = z
181180 message : "Either url, html, or markdown is required" ,
182181 } ) ;
183182
184- export const apiGenerateSchemaRequestSchema = z . object ( {
185- prompt : apiUserPromptSchema ,
186- existingSchema : z . record ( z . string ( ) , z . unknown ( ) ) . optional ( ) ,
187- model : z . enum ( MODEL_NAMES ) . optional ( ) ,
188- } ) ;
189-
190183export const apiSearchRequestSchema = z
191184 . object ( {
192185 query : z . string ( ) . min ( 1 ) . max ( 500 ) ,
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import type {
33 apiCrawlRequestSchema ,
44 apiExtractRequestBaseSchema ,
55 apiFetchConfigSchema ,
6- apiGenerateSchemaRequestSchema ,
76 apiHistoryFilterSchema ,
87 apiHtmlModeSchema ,
98 apiLlmConfigSchema ,
@@ -36,7 +35,6 @@ export type ApiFetchConfig = z.infer<typeof apiFetchConfigSchema>;
3635export type ApiLlmConfig = z . infer < typeof apiLlmConfigSchema > ;
3736export type ApiScrapeRequest = z . infer < typeof apiScrapeRequestSchema > ;
3837export type ApiExtractRequestBase = z . infer < typeof apiExtractRequestBaseSchema > ;
39- export type ApiGenerateSchemaRequest = z . infer < typeof apiGenerateSchemaRequestSchema > ;
4038export type ApiSearchRequest = z . infer < typeof apiSearchRequestSchema > ;
4139export type ApiHistoryFilterInput = z . infer < typeof apiHistoryFilterSchema > ;
4240export type ApiHistoryService = Exclude < ApiHistoryFilterInput [ "service" ] , undefined > ;
@@ -48,6 +46,5 @@ export type ApiScrapeOptions = Omit<ApiScrapeRequest, "url">;
4846export type ApiExtractOptions = Omit < ApiExtractRequestBase , "url" | "html" | "markdown" > & {
4947 schema ?: unknown ;
5048} ;
51- export type ApiGenerateSchemaOptions = Omit < ApiGenerateSchemaRequest , "prompt" > ;
5249export type ApiSearchOptions = Omit < ApiSearchRequest , "query" > ;
5350export type ApiCrawlOptions = Omit < ApiCrawlRequest , "url" > ;
You can’t perform that action at this time.
0 commit comments