Skip to content

Commit

Permalink
Remove _v2 suffixes from collections host functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjohnsonpint committed Oct 9, 2024
1 parent 9d228ef commit 98704db
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 32 deletions.
16 changes: 8 additions & 8 deletions runtime/hostfunctions/collections.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ import (

func init() {

registerHostFunction("hypermode", "computeDistance_v2", collections.ComputeDistance,
registerHostFunction("hypermode", "computeDistance", collections.ComputeDistance,
withCancelledMessage("Cancelled computing distance."),
withErrorMessage("Error computing distance."),
withMessageDetail(func(collectionName, namespace, searchMethod string) string {
return fmt.Sprintf("Collection: %s, Namespace: %s, Method: %s", collectionName, namespace, searchMethod)
}))

registerHostFunction("hypermode", "deleteFromCollection_v2", collections.DeleteFromCollection,
registerHostFunction("hypermode", "deleteFromCollection", collections.DeleteFromCollection,
withCancelledMessage("Cancelled deleting from collection."),
withErrorMessage("Error deleting from collection."),
withMessageDetail(func(collectionName, namespace, key string) string {
Expand All @@ -38,14 +38,14 @@ func init() {
return fmt.Sprintf("Collection: %s", collectionName)
}))

registerHostFunction("hypermode", "getTextFromCollection_v2", collections.GetTextFromCollection,
registerHostFunction("hypermode", "getTextFromCollection", collections.GetTextFromCollection,
withCancelledMessage("Cancelled getting text from collection."),
withErrorMessage("Error getting text from collection."),
withMessageDetail(func(collectionName, namespace, key string) string {
return fmt.Sprintf("Collection: %s, Namespace: %s, Key: %s", collectionName, namespace, key)
}))

registerHostFunction("hypermode", "getTextsFromCollection_v2", collections.GetTextsFromCollection,
registerHostFunction("hypermode", "getTextsFromCollection", collections.GetTextsFromCollection,
withCancelledMessage("Cancelled getting texts from collection."),
withErrorMessage("Error getting texts from collection."),
withMessageDetail(func(collectionName, namespace string) string {
Expand All @@ -66,14 +66,14 @@ func init() {
return fmt.Sprintf("Collection: %s, Namespace: %s, ID: %s", collectionName, namespace, id)
}))

registerHostFunction("hypermode", "nnClassifyCollection_v2", collections.NnClassify,
registerHostFunction("hypermode", "nnClassifyCollection", collections.NnClassify,
withCancelledMessage("Cancelled classification."),
withErrorMessage("Error during classification."),
withMessageDetail(func(collectionName, namespace, searchMethod string) string {
return fmt.Sprintf("Collection: %s, Namespace: %s, Method: %s", collectionName, namespace, searchMethod)
}))

registerHostFunction("hypermode", "recomputeSearchMethod_v2", collections.RecomputeSearchMethod,
registerHostFunction("hypermode", "recomputeSearchMethod", collections.RecomputeSearchMethod,
withStartingMessage("Starting recomputing search method for collection."),
withCompletedMessage("Completed recomputing search method for collection."),
withCancelledMessage("Cancelled recomputing search method for collection."),
Expand All @@ -82,7 +82,7 @@ func init() {
return fmt.Sprintf("Collection: %s, Namespace: %s, Method: %s", collectionName, namespace, searchMethod)
}))

registerHostFunction("hypermode", "searchCollection_v2", collections.SearchCollection,
registerHostFunction("hypermode", "searchCollection", collections.SearchCollection,
withCancelledMessage("Cancelled searching collection."),
withErrorMessage("Error searching collection."),
withMessageDetail(func(collectionName string, namespaces []string, searchMethod string) string {
Expand All @@ -96,7 +96,7 @@ func init() {
return fmt.Sprintf("Collection: %s, Namespaces: %v, Method: %s", collectionName, namespaces, searchMethod)
}))

registerHostFunction("hypermode", "upsertToCollection_v2", collections.UpsertToCollection,
registerHostFunction("hypermode", "upsertToCollection", collections.UpsertToCollection,
withCancelledMessage("Cancelled collection upsert."),
withErrorMessage("Error upserting to collection."),
withMessageDetail(func(collectionName, namespace string, keys []string) string {
Expand Down
16 changes: 8 additions & 8 deletions sdk/assemblyscript/src/assembly/collections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export class CollectionClassificationResultObject {
}

// @ts-expect-error: decorator
@external("hypermode", "upsertToCollection_v2")
@external("hypermode", "upsertToCollection")
declare function hostUpsertToCollection(
collection: string,
namespace: string,
Expand All @@ -156,15 +156,15 @@ declare function hostUpsertToCollection(
): CollectionMutationResult;

// @ts-expect-error: decorator
@external("hypermode", "deleteFromCollection_v2")
@external("hypermode", "deleteFromCollection")
declare function hostDeleteFromCollection(
collection: string,
namespace: string,
key: string,
): CollectionMutationResult;

// @ts-expect-error: decorator
@external("hypermode", "searchCollection_v2")
@external("hypermode", "searchCollection")
declare function hostSearchCollection(
collection: string,
namespaces: string[],
Expand All @@ -175,7 +175,7 @@ declare function hostSearchCollection(
): CollectionSearchResult;

// @ts-expect-error: decorator
@external("hypermode", "nnClassifyCollection_v2")
@external("hypermode", "nnClassifyCollection")
declare function hostNnClassifyCollection(
collection: string,
namespace: string,
Expand All @@ -184,15 +184,15 @@ declare function hostNnClassifyCollection(
): CollectionClassificationResult;

// @ts-expect-error: decorator
@external("hypermode", "recomputeSearchMethod_v2")
@external("hypermode", "recomputeSearchMethod")
declare function hostRecomputeSearchMethod(
collection: string,
namespace: string,
searchMethod: string,
): SearchMethodMutationResult;

// @ts-expect-error: decorator
@external("hypermode", "computeDistance_v2")
@external("hypermode", "computeDistance")
declare function hostComputeDistance(
collection: string,
namespace: string,
Expand All @@ -202,15 +202,15 @@ declare function hostComputeDistance(
): CollectionSearchResultObject;

// @ts-expect-error: decorator
@external("hypermode", "getTextFromCollection_v2")
@external("hypermode", "getTextFromCollection")
declare function hostGetTextFromCollection(
collection: string,
namespace: string,
key: string,
): string;

// @ts-expect-error: decorator
@external("hypermode", "getTextsFromCollection_v2")
@external("hypermode", "getTextsFromCollection")
declare function hostGetTextsFromCollection(
collection: string,
namespace: string,
Expand Down
32 changes: 16 additions & 16 deletions sdk/go/pkg/collections/imports_wasi.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ package collections
import "unsafe"

//go:noescape
//go:wasmimport hypermode upsertToCollection_v2
//go:wasmimport hypermode upsertToCollection
func _hostUpsertToCollection(collection, namespace *string, keys, texts, labels unsafe.Pointer) unsafe.Pointer

//hypermode:import hypermode upsertToCollection_v2
//hypermode:import hypermode upsertToCollection
func hostUpsertToCollection(collection, namespace *string, keys, texts *[]string, labels *[][]string) *CollectionMutationResult {
keysPointer := unsafe.Pointer(keys)
textsPointer := unsafe.Pointer(texts)
Expand All @@ -30,10 +30,10 @@ func hostUpsertToCollection(collection, namespace *string, keys, texts *[]string
}

//go:noescape
//go:wasmimport hypermode deleteFromCollection_v2
//go:wasmimport hypermode deleteFromCollection
func _hostDeleteFromCollection(collection, namespace, key *string) unsafe.Pointer

//hypermode:import hypermode deleteFromCollection_v2
//hypermode:import hypermode deleteFromCollection
func hostDeleteFromCollection(collection, namespace, key *string) *CollectionMutationResult {
response := _hostDeleteFromCollection(collection, namespace, key)
if response == nil {
Expand All @@ -43,10 +43,10 @@ func hostDeleteFromCollection(collection, namespace, key *string) *CollectionMut
}

//go:noescape
//go:wasmimport hypermode searchCollection_v2
//go:wasmimport hypermode searchCollection
func _hostSearchCollection(collection *string, namespaces unsafe.Pointer, searchMethod, text *string, limit int32, returnText bool) unsafe.Pointer

//hypermode:import hypermode searchCollection_v2
//hypermode:import hypermode searchCollection
func hostSearchCollection(collection *string, namespaces *[]string, searchMethod, text *string, limit int32, returnText bool) *CollectionSearchResult {
namespacesPtr := unsafe.Pointer(namespaces)
response := _hostSearchCollection(collection, namespacesPtr, searchMethod, text, limit, returnText)
Expand All @@ -57,10 +57,10 @@ func hostSearchCollection(collection *string, namespaces *[]string, searchMethod
}

//go:noescape
//go:wasmimport hypermode nnClassifyCollection_v2
//go:wasmimport hypermode nnClassifyCollection
func _hostNnClassifyCollection(collection, namespace, searchMethod, text *string) unsafe.Pointer

//hypermode:import hypermode nnClassifyCollection_v2
//hypermode:import hypermode nnClassifyCollection
func hostNnClassifyCollection(collection, namespace, searchMethod, text *string) *CollectionClassificationResult {
response := _hostNnClassifyCollection(collection, namespace, searchMethod, text)
if response == nil {
Expand All @@ -70,10 +70,10 @@ func hostNnClassifyCollection(collection, namespace, searchMethod, text *string)
}

//go:noescape
//go:wasmimport hypermode recomputeSearchMethod_v2
//go:wasmimport hypermode recomputeSearchMethod
func _hostRecomputeSearchMethod(collection, namespace, searchMethod *string) unsafe.Pointer

//hypermode:import hypermode recomputeSearchMethod_v2
//hypermode:import hypermode recomputeSearchMethod
func hostRecomputeSearchMethod(collection, namespace, searchMethod *string) *SearchMethodMutationResult {
response := _hostRecomputeSearchMethod(collection, namespace, searchMethod)
if response == nil {
Expand All @@ -83,10 +83,10 @@ func hostRecomputeSearchMethod(collection, namespace, searchMethod *string) *Sea
}

//go:noescape
//go:wasmimport hypermode computeDistance_v2
//go:wasmimport hypermode computeDistance
func _hostComputeDistance(collection, namespace, searchMethod, key1, key2 *string) unsafe.Pointer

//hypermode:import hypermode computeDistance_v2
//hypermode:import hypermode computeDistance
func hostComputeDistance(collection, namespace, searchMethod, key1, key2 *string) *CollectionSearchResultObject {
response := _hostComputeDistance(collection, namespace, searchMethod, key1, key2)
if response == nil {
Expand All @@ -96,10 +96,10 @@ func hostComputeDistance(collection, namespace, searchMethod, key1, key2 *string
}

//go:noescape
//go:wasmimport hypermode getTextFromCollection_v2
//go:wasmimport hypermode getTextFromCollection
func _hostGetTextFromCollection(collection, namespace, key *string) unsafe.Pointer

//hypermode:import hypermode getTextFromCollection_v2
//hypermode:import hypermode getTextFromCollection
func hostGetTextFromCollection(collection, namespace, key *string) *string {
response := _hostGetTextFromCollection(collection, namespace, key)
if response == nil {
Expand All @@ -109,10 +109,10 @@ func hostGetTextFromCollection(collection, namespace, key *string) *string {
}

//go:noescape
//go:wasmimport hypermode getTextsFromCollection_v2
//go:wasmimport hypermode getTextsFromCollection
func _hostGetTextsFromCollection(collection, namespace *string) unsafe.Pointer

//hypermode:import hypermode getTextsFromCollection_v2
//hypermode:import hypermode getTextsFromCollection
func hostGetTextsFromCollection(collection, namespace *string) *map[string]string {
response := _hostGetTextsFromCollection(collection, namespace)
if response == nil {
Expand Down

0 comments on commit 98704db

Please sign in to comment.